Page 1 of 1

arrayDecode - iOS glitch?

Posted: Thu Apr 21, 2011 3:11 am
by witeowl
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:

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
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... :cry:

Help?

Re: arrayDecode - iOS glitch?

Posted: Thu Apr 21, 2011 11:47 pm
by jiml
See my thread "iOS arrayencode bug?" on the developers' list.
BenB responded
Hi Jim,

A quick update on your issue. The team managed to find the cause thanks to your excellent sample stack and have fixed the issue. Look out for it in the next build.

Warm regards and thanks again for your work in helping us resolve the issue,

Ben
I haven't tried it yet myself becasue I discovered if you save your array as a customproperty of a substack all is fine.
Still, If it is not fixed you should alert Ben.

Re: arrayDecode - iOS glitch?

Posted: Fri Apr 22, 2011 12:24 am
by witeowl
jiml wrote:See my thread "iOS arrayencode bug?" on the developers' list...

I haven't tried it yet myself becasue I discovered if you save your array as a customproperty of a substack all is fine.
Still, If it is not fixed you should alert Ben.
OK, I think I'll never find that thread because I'm not in the developer's program. The list I'm on is the use-livecode list.

Any chance you can forward me the relevant contents of that list so I can decide whether to alert Ben (after I figure out who he is)?

Re: arrayDecode - iOS glitch?

Posted: Fri Apr 22, 2011 10:07 am
by Klaus
HI witeowl,
witeowl wrote:...Beyond that: I didn't know I could save changes to substacks in iOS.
beware, just like in a desktop app, you cannot save substacks that are part of the standalone mainstack!
You need to save these stacks as separate files!


Best

Klaus