Re: NSDocumentController, NSDocument and toolbars
Re: NSDocumentController, NSDocument and toolbars
- Subject: Re: NSDocumentController, NSDocument and toolbars
- From: Graham Cox <email@hidden>
- Date: Mon, 28 Jul 2008 00:20:29 +1000
On 27 Jul 2008, at 10:02 pm, John Love wrote:
I call:
[toolbarItem setTarget:self];
[toolbarItem setAction:@selector(openDocument:)]; as Apple specifies.
Well, what do you want the tool bar item to actually *do*? Whatever it
is, and whatever object is responsible for handling it is your action
and target, respectively. Just like a menu item.
openDocument: is a method of NSDocumentController, not NSDocument ...
*unless* I place this action method within my MedDocument ... and
such a
place is clearly wrong
So maybe set the target to the document controller, not self?
What I
*do* want to override within MedDocument is: - (BOOL)
readFromURL:(NSURL*)absoluteURL ofType:(NSString*)typeName
error:(NSError**)outError; as one of the few methods which Apple
specifies
should be overridden.
Not sure this relates in any way to the toolbar discussion. Does it?
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