• 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
when to register
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

when to register


  • Subject: when to register
  • From: Mike Abdullah <email@hidden>
  • Date: Tue, 28 Feb 2006 00:21:13 +0000

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.

So, when should I register for the observations exactly?

Any help much appreciated,
Mike A.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: when to register
      • From: Scott Anguish <email@hidden>
  • Prev by Date: Solved: Link & Table Cursors in NSTextView
  • Next by Date: Subclassing NSKeyedArchiver
  • Previous by thread: Re: how to intercept call to [NSTextView print:] of NSSearchfield in a toolbar
  • Next by thread: Re: when to register
  • Index(es):
    • Date
    • Thread