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

NSDocumentController, NSDocument and toolbars


  • Subject: NSDocumentController, NSDocument and toolbars
  • From: "John Love" <email@hidden>
  • Date: Sun, 27 Jul 2008 08:02:51 -0400

I sub-class NSDocument and call it MedDocument. My code is similar to
Apple's SimpleToolbar .. the biggest difference is that I create a Category
= MedDocument+ToolbarDelegateCategory in order to compartmentalize the code,
i.e., keep the toolbar stuff in a separate file. And it works .. except for
one item; that is, within the delegate methods: - (NSToolbarItem*)
toolbar:(NSToolbar*)toolbar itemForItemIdentifier:(NSString*)itemIdent
willBeInsertedIntoToolbar:(BOOL)willBeInserted; and - (void)
toolbarWillAddItem:(NSNotification*)notif; I call:
[toolbarItem setTarget:self];
[toolbarItem setAction:@selector(openDocument:)]; as Apple specifies. But
openDocument: is a method of NSDocumentController, not NSDocument ...
*unless* I place this action method within my MedDocument ... and such a
place is clearly wrong .. besides in Apple's sample it is not there. 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. What is going on here? John Love
_______________________________________________

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: Graham Cox <email@hidden>
  • Prev by Date: Re: NSWindow resize problems
  • Next by Date: Web View silently fails
  • Previous by thread: Re: IB view transitions, CA, NSWindow animation
  • Next by thread: Re: NSDocumentController, NSDocument and toolbars
  • Index(es):
    • Date
    • Thread