> 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 protected])
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]