Page 1 of 1

Error detection for iOS simulator?

Posted: Thu Jul 21, 2011 4:09 pm
by Simon
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

Re: Error detection for iOS simulator?

Posted: Thu Jul 21, 2011 4:45 pm
by andyh1234
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

Re: Error detection for iOS simulator?

Posted: Thu Jul 21, 2011 5:01 pm
by Simon
SWEET!
Thanks Andy that does it.

Simon