Re: multi-window document best practices?
Re: multi-window document best practices?
- Subject: Re: multi-window document best practices?
- From: Willeke <email@hidden>
- Date: Mon, 14 May 2012 00:07:46 +0200
Op 13 mei 2012, om 04:11 heeft email@hidden het volgende geschreven:
> If it were important that nibs should be built differently for single and multiple window cases, I'd think the docs would mention it someplace, but they don't
They do.
The documentation of awakeFromNib says
It is recommended that you maintain a one-to-one correspondence between your File’s Owner objects and their associated nib files.
You Should Subclass NSWindowController in Document-Based App Programming Guide for Mac says
Reasons to Subclass NSWindowController: If your document requires or allows multiple windows for a single document, that is a good reason to subclass NSWindowController.
How to Subclass NSWindowController: The NSWindowController subclass instance should be the File’s Owner for the nib file because that creates better separation between the view-related logic and the model-related logic.
If each NIB has its own owner, awakeFromNib is only called once.
Willeke
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden