Re: NSWindowController for Prefs XIB Question (Core Data involved)
Re: NSWindowController for Prefs XIB Question (Core Data involved)
- Subject: Re: NSWindowController for Prefs XIB Question (Core Data involved)
- From: Quincey Morris <email@hidden>
- Date: Fri, 21 May 2010 00:16:21 -0700
On May 20, 2010, at 23:51, Steve Cronin wrote:
> I have created a brand new xib file: ptest
> XCode creates the xib with a FilesOwner, FirstResponder, Application, and Window (set to releaseOnClose and visibleAtLaunch)
...
> The new ptest.xib window will open once but never again if I close it.
> this is true regardless of whether I set the window to releaseOnClose or not
*Do not* set visibleAtLaunch to YES. You want the window to be shown via the window controller's 'showWindow:' method, not have it appear before that under its own initiative. There are *very* few situations where setting visibleAtLaunch is appropriate.
*Do not* set releaseOnClose to YES in this case. Once the window is released, you need to have the nib be re-loaded to get a new instance, which means you need to destroy and recreate your window controller too. (You could do that, but it's easier to leave both the window controller and the window in existence.) You'd normally want releaseOnClose for something like a document window -- when it's gone, so is the document and its window controller -- but not for a window belonging to a persistent window controller.
_______________________________________________
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