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

Re: NSDocument


  • Subject: Re: NSDocument
  • From: Quincey Morris <email@hidden>
  • Date: Thu, 14 Jan 2010 12:27:35 -0800

On Jan 14, 2010, at 11:57, David Blanton wrote:

> When my document based app starts up the awakeFromNib method in my NSDocument subclass is called.
>
> When I choose Open a new NSDocument is instanced but this does not call awakeFromNib.
>
> Am I missing a setting?
>
> I need awakeFromNib to be called for any instance on my NSDocument sublass.

'[NSDocument awakeFromNib]' is invoked because (or when, if you prefer) the document is File's Owner for the associated nib file. Your symptoms would suggest that it's being set as File's Owner when a File -> New... is done (since that's what you get for free when the application starts up) but not when a File -> Open... is done. Is it possible there are two nib files being used in these two situations?

If you've set the document's window controller as File's Owner, then *it* will get the 'awakeFromNib' instead of the document.

Also, as usual when an application mysteriously fails to do something, it's vital to check the log for exception error messages -- something I typically forget to do.

Does any of that suggest anything helpful?


_______________________________________________

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: NSDocument
      • From: David Blanton <email@hidden>
References: 
 >NSDocument (From: David Blanton <email@hidden>)

  • Prev by Date: Re: Cancelable NSBlockOperations
  • Next by Date: Re: NSArrayController Conceptual Problem
  • Previous by thread: NSDocument
  • Next by thread: Re: NSDocument
  • Index(es):
    • Date
    • Thread