I do not have an object whose set to MyDocument.

On Jan 14, 2010, at 2:34 PM, Charles Jenkins wrote:

I'm a noob, but I'm gonna give my interpretation anyway and let the experts have a chance to correct my misunderstanding.

I think Matt means that if you use IB to look at your MyDocument.nib (or .xib), in the window where you see File's Owner and other stuff, you should NOT see another NSObject whose Class is set to 'MyDocument'. If you have that, then your app will instantiate MyDocument, which will load the NIB file, which will instantiate another MyDocument--and weirdness ensues.

On 2010-01-14 16:19, David Blanton wrote:
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/cjenkins%40tec-usa.com

This email sent to cjenk...@tec-usa.com


_______________________________________________

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/airedale%40tularosa.net

This email sent to aired...@tularosa.net



_______________________________________________

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