Re: Application Menu - Preferences
Re: Application Menu - Preferences
- Subject: Re: Application Menu - Preferences
- From: Graham Cox <email@hidden>
- Date: Thu, 25 Feb 2010 09:58:02 +1100
On 25/02/2010, at 9:39 AM, Gabriel Fernandez wrote:
> Okay, I'm a skeptical person, so I have to ask why isn't there a "preferences" method in the FirstResponder IB object to begin with?
> But more to the point, how do I get a reference to the application delegate instance?
>
First Responder isn't a real object - it's a proxy for the "responder chain" and in fact as a target its value is nil.
Since there are several solutions to implementing preferences (including none), having a declared "-preferences:" action method has no value.
The application delegate is a real object, but you have to create it by adding it to the nib and connecting it up to the 'delegate' outlet of the application. Typically you do that by subclassing NSObject and so drag an NSObject icon into the nib and changing its class to the name of your subclass.
--Graham
_______________________________________________
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