Re: [Solved]NSAppleScript returning wrong error info
Re: [Solved]NSAppleScript returning wrong error info
- Subject: Re: [Solved]NSAppleScript returning wrong error info
- From: Vinay Prabhu <email@hidden>
- Date: Wed, 19 Mar 2008 08:54:58 +0530
Initializing the errorInfo to nil did the trick.
When no error occurs, NSAppleScript will not touch the error dictionary.
So I was trying to access the dictionary pointing to junk memory.
Thanks for the help.
-Vinay
On Mar 18, 2008, at 7:44 PM, Nir Soffer wrote:
On Mar 18, 2008, at 11:47, Vinay Prabhu wrote:
I am trying to create a NSAppleScript object using a applescript
file.
The code is as follows,
NSDictionary* errorInfo;
NSAppleScript *script = [[NSAppleScriptalloc]
initWithContentsOfURL: scriptURL error: &errorInfo];
As per the documentation, on return 'errorInfo' should point to a
dictionary containing error messages.
No, the docs say:
"On return, if an error occurs, a pointer to an error information
dictionary."
If an no error occurs, the value is undefined. Check for errors by
testing the return value, not the error dictionary.
Best Regards,
Nir Soffer
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden