Re: Won't Applescript command use defined ivars?
Re: Won't Applescript command use defined ivars?
- Subject: Re: Won't Applescript command use defined ivars?
- From: Martin Wierschin <email@hidden>
- Date: Tue, 30 Aug 2011 14:25:48 -0700
> If I have an ivar that is global in scope,
As Scott mentioned, your ivar isn't global. Each instance of your class has its own ivar. Also as he mentioned, you seem to be ignoring the memory management guidelines. That's not the immediate cause of your troubles, but is important for you to understand and fix.
What exactly is your class? Your post omits important parts:
> @interface...
> {
> NSString *userName;
> }
Are you subclassing NSScriptCommand? If so, then I'm guessing that the AppleScript machinery is creating a new instance of your class every time you run your AppleScript. Which means that your instance is not in existence when the -applicationDidFinishLaunching method might be called, and hence why your ivar is nil.
~Martin
_______________________________________________
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