Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: when to register



OK, now I feel a little foolish! I had overlooked that method thinking it was for when using a custom windowController only. Should have read the docs more carefully! Sorry.

Mike.

On 28 Feb 2006, at 08:43, Scott Anguish wrote:

perhaps – windowControllerDidLoadNib:

On Feb 27, 2006, at 7:21 PM, Mike Abdullah wrote:

I have a document based app. In my document's nib, I have the NSDocument subclass, a subclass of NSObject that holds the data for the document and a NSObjectController.

I have got the NSObjectController to bind my NSObject to the window's fields wonderfully. However, I having problems expanding this. As part of my document window, I have a box that sets the view it displays based upon one of the keys of my document data. I cannot see any way of doing this directly from the bindings in Interface Builder, so I figure what I want to do is register my NSDocument for Key Value Observation with that key of my NSObject.

However, here's the difficulty, the init method of my NSDocument happens before the init of my NSObject, so I cannot register for the observations at that point. I can register during my NSDocument's awakeFromNib method, but this happens after the particular key is first set in the NSObject. And more importantly, awakeFromNib occurs after the window has been loaded and displayed, I need to first set this box's content before the window is visible to the user.


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >when to register (From: Mike Abdullah <email@hidden>)
 >Re: when to register (From: Scott Anguish <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.