• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Won't Applescript command use defined ivars?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Won't Applescript command use defined ivars?
      • From: Chris Paveglio <email@hidden>
References: 
 >Won't Applescript command use defined ivars? (From: Chris Paveglio <email@hidden>)

  • Prev by Date: Re: stdout or stderr file path on iPhone?
  • Next by Date: Re: stdout or stderr file path on iPhone?
  • Previous by thread: Re: Won't Applescript command use defined ivars?
  • Next by thread: Re: Won't Applescript command use defined ivars?
  • Index(es):
    • Date
    • Thread