Thank you for commenting but now I am really confused. When a project is created from the document based template it contains files MyDocument.h and MyDocument.m which define the interface and implementation for a class MyDocument that inherits from NSDocument.

Whne built and and run if any one of many init methods are implemented and awakeFromNib is implemented these are called.

So, I do not understand what you have said.

- db

On Jan 14, 2010, at 1:53 PM, Matt Neuburg wrote:

On Thu, 14 Jan 2010 12:57:57 -0700, David Blanton <aired...@tularosa.net >
said:
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.

I am in dire straits on this on,  any help ...appreciated.

In a standard doc-based app, there is no NSDocument instance in the nib. So
naturally no NSDocument instance ever awakes from a nib. So naturally
awakeFromNib is never called. The fact that your NSDocument subclass's
awakeFromNib is *ever* called suggests that you have already done something
very odd.

Of course I could just be confused, but it sounds to me like you might be asking the wrong question. Is the question how to perform initializations as a document is opened? The Document-Based Applications Overview contains a
discussion of this question.

m.

--
matt neuburg, phd = m...@tidbits.com, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings






_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to