On Sun, Feb 13, 2011 at 9:27 PM, Graham Cox <graham....@bigpond.com> wrote: >> 3. When should the reference to the model be set up in each controller? > > It will be done for you when the document is created from the nib. All you > need to do is populate the model from the file when the file is opened. > NSDocument provides an override for that.
I think it's worth being pedantic here, given some recent confusion: The document itself (your NSDocument instance) doesn't live in the nib. It will *load* its nib, or an NSWindowController will do so on its behalf. But it will already exist before the nib is unfrozen. Sometimes people get confused and drop an NSDocument instance into the nib window, thinking that it should be created along with the rest of the document-related objects. Then they wind up with two NSDocument instances, one of which is hooked up to all the interface objects and controllers, while NSDocumentController only knows of the other one. --Kyle Sluder _______________________________________________ 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