arrayDecode - iOS glitch?
Posted: Thu Apr 21, 2011 3:11 am
OK, I hope this makes sense...
After much hair-pulling, I finally figured out that the reason that my app appeared to (recently begin to) lose all its data was just that there's something that will cause a text file to no longer to be decodable into its array. There's no result, it just fails at "put arrayDecode(tFile) into tData". It doesn't kick me out or lock up, the handler just terminates. Here is the relevant code:
This first happened with some data I had manually created and transferred to the device, so I went ahead and cleared that (after much hair-pulling and step-by-step "answers" to figure out exactly where the break-down was occurring) and reverted to just creating the data on the device, figuring that I did something wrong with my manually created data. All was going well... arrays were being encoded and decoded... for a while, then the one txt file again became undecodable.
It IS, however, decodable within LiveCode. I manually pulled the file off the device and imported it into my app using the same lines of code and it's totally usable from within livecode. Just not on the device.
Is there a limit to the size dataDecode can handle on an iOS device? It's a paltry 20kb, but... Jeez, how do I track down this sort of problem? It's really frustrating to think that all my hours put into this app might be for naught all because of this...
Help?
After much hair-pulling, I finally figured out that the reason that my app appeared to (recently begin to) lose all its data was just that there's something that will cause a text file to no longer to be decodable into its array. There's no result, it just fails at "put arrayDecode(tFile) into tData". It doesn't kick me out or lock up, the handler just terminates. Here is the relevant code:
Code: Select all
put URL ("binfile:masterdata.txt") into tFile
if the result is not empty then answer the result
put arrayDecode(tFile) into tData
if the result is not empty then answer the result
put tData["Master"] into gData
It IS, however, decodable within LiveCode. I manually pulled the file off the device and imported it into my app using the same lines of code and it's totally usable from within livecode. Just not on the device.
Is there a limit to the size dataDecode can handle on an iOS device? It's a paltry 20kb, but... Jeez, how do I track down this sort of problem? It's really frustrating to think that all my hours put into this app might be for naught all because of this...

Help?