Error detection for iOS simulator?

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Error detection for iOS simulator?

Post by Simon » Thu Jul 21, 2011 4:09 pm

Hello,
Before I spend time on this has anyone created a script to "Answer theError" during iOS simulator debugging?
I'm looking for a similar function as the IDE has.
My scripts run great on Mac/PC but then bomb in the simulator. Any code out there?

TIA
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

andyh1234
Posts: 476
Joined: Mon Aug 13, 2007 4:44 pm
Contact:

Re: Error detection for iOS simulator?

Post by andyh1234 » Thu Jul 21, 2011 4:45 pm

Try adding the following code to the main stack to see if it catches the error before the app bombs...

on errorDialog pExecutionError, pParseError
if item 2 of line 1 of pExecutionError is 0 then
    answer "An error occurred " & cr & cr & pExecutionError
else
    answer "An error occurred on line: " & item 2 of line 1 of pExecutionError
end if
end errorDialog

This has worked for me as the error is quite often caused by trying to access an object that doesn't exist, and this will catch it and let you know which line of your code the issue is on.

Andy

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Error detection for iOS simulator?

Post by Simon » Thu Jul 21, 2011 5:01 pm

SWEET!
Thanks Andy that does it.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply