• 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: NSDocumentController, NSDocument and toolbars
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSDocumentController, NSDocument and toolbars
      • From: "John Love" <email@hidden>
References: 
 >NSDocumentController, NSDocument and toolbars (From: "John Love" <email@hidden>)

  • Prev by Date: Re: Compiler doesn't see instance variable
  • Next by Date: Re: Web View silently fails
  • Previous by thread: NSDocumentController, NSDocument and toolbars
  • Next by thread: Re: NSDocumentController, NSDocument and toolbars
  • Index(es):
    • Date
    • Thread