Le 18 mars 08 à 10:47, Vinay Prabhu a écrit :
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.
But strangely, on return, 'errorInfo' is not pointing to object of
NSDictionary, instead it is
pointing to '_NSRepresentationInfo' object.
I have used the following code to find the class of 'errorInfo',
Class temp = [errorInfo class];
NSLog(@"%@", temp);
I can see the class type as _NSRepresentationInfo in console, on
running the code.
Because of this, my application crashes, when I use NSDictionary
API's like objectForKey, count etc on errorInfo.
The crash log shows,
[_NSRepresentationInfo count] selector not recognized
This happens when I run my application in Japanese language.
Any idea, why NSAppleScript is not returning NSDictionary object,
when error occurs?
Any help is greatly appreciated.
Thanks and Regards
-Vinay
Are you sure an error occured? Try to initialize your error to nil
before creating your script. I think initWithContentsOfURL: error: do
not touch your errorInfo object and as it is not initialized, is point
to a random memory adress that contains an _NSRepresentationInfo.
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]