Re: window controller question
Re: window controller question
- Subject: Re: window controller question
- From: Jim McGowan <email@hidden>
- Date: Tue, 29 Jun 2010 12:51:45 +0800
On 29 Jun 2010, at 3:40, Rainer Standke wrote:
> trying to clarify another newbie question. I have an app that has multiple windows per document. I'd like to be able to open and close those windows independently from each-other. I understand that I should use NSWindowControllers. So what I think I should be doing is this:
>
> - when new document opens I put its window controller into an iVar so that I can use it as a reference when the user selects a menu to open the main window.
>
> - then I instantiate one new window controller for each additional window, and put each of those into an iVar to be used in a method that opens the corresponding window, like an IBAction hooked up to menu item.
>
That is essentially fine. However, you should keep in mind that the cocoa document system has the concepts of primary and secondary windows for a document. Secondary windows can be opened and closed without closing the document, when the primary window is closed the document and any secondary windows are also closed. The "The Roles of Key Objects in Document-Based Applications" and "Window Closing Behavior" chapters in the "Document-Based Applications Overview" guide cover this.
Jim
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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