Strange!

Dan Friedman dan at clearvisiontech.com
Fri Apr 25 17:40:57 EDT 2014


Chris,

Thank you for the reply and advice.  I have been popping answer dialogs all morning.  I still have no clue.  I tried putting your code snippet in the stack and card scripts, but nothing was trapped.

At this point, I have commented out everything in the card script except openStack and preOpenStack.  So, I have the IDENTICAL card script in two cards.  Card A works fine, card B fails.  I can't figure it out!  They do have different controls... Is it possible that a control on the card could cause a problem?  even though the control isn't being accessed?

Wait a second....

Ok, found the problem.  I have an image on the card that is (was) failing that I use to hold an image temporarily.  I set the fileName of that image to empty, and now it works.  Obviously, LiveCode crapped out when it tried to load the image on the card.  Even though I never accessed the image in code, and the image is invisible, LiveCode didn't like the url set in the fileName of the image.  I should probability report the issue - LC should bail and should probably report some type of error/warning.

Thanks for the help!  In describing the problem to you, I began to think about the controls, which led me to the answer.

-Dan


> Dan,
> 
> Sounds like some debugging is in order which, as I’m sure you know, can be a little tricky for iOS apps. I would recommend using put statements and/or answer dialogs to try and narrow down where the problem lies. Since preOpenCard fires but openCard does not, my guess is you’ve got an error occurring at some point during preOpenCard, and it’s basically stopping the app in its tracks.
> 
> A handy little script I picked up along the way allows you to easily see when runtime errors occur in any app, but I find it especially useful for mobile apps when testing in the simulator or on a device. I got this from Jacque Landman-Gay, who I believe originally got it from Andre Garzia.
> 
> 
> 	constant kDebug = "answer"
> 
> on log pMsg 
>     switch kDebug
>         case "msg"
>             put pMsg & cr
>             break
>         case "file"
>             put pMsg & cr after url ("file:" && the effective filename of this stack & ".log")
>             break
>         case "answer" -- jlg: added
>             answer pMsg titled the short name of this card
>             break
>     end switch
> end log
> 
> on errorDialog pErr -- catches and reports system errors
>     log pErr
> end errorDialog
> 
> 
> Place this in your stack script. Then set the kDebug constant to whichever debug method you prefer. If there’s an error somewhere in preOpenCard, this should catch it and help you get started with figuring out the problem
> 
> Good luck!
> 
> Chris

>> I have an mobile project that I've been working on for some time now.  It's already in the app store (and google play) and it's been running fine.  I opened the stack this morning to make some updates, and I find that I have one card that is no longer passing messages.  preOpenCard get's fired, but openCard is not?  Other cards in the same stack work fine.  I don't have lock messages on, or anything else I can think of that would cause this.
>> 
>> The card works fine in LiveCode, but fails in the simulator and on a real device.
>> 
>> LC 6.5.2 and 6.6.1
>> XCode 5.1.1
>> 
>> There must be some property or something that got set that I can't think of.  I have stepped through the code and I can't find anything.   I even created a new card, and copied the objects and script to the new card, but got the same result.
>> 
>> Any ideas?
>> 
>> -Dan
>> 


Thank you!

Dan Friedman
CEO, ClearVision Technologies, Inc.
Voice: 909/484-2052
Fax: 866/620-4796
http://www.clearvisiontech.com

Does your school have a mobile app?  Check out schoolGO!









More information about the Use-livecode mailing list