Re: NSApplication's behavior
Re: NSApplication's behavior
- Subject: Re: NSApplication's behavior
- From: Jonathan Hess <email@hidden>
- Date: Thu, 1 Oct 2009 01:26:07 -0700
On Sep 30, 2009, at 7:50 PM, Mark Hurley wrote:
> Still learning the Cocoa Window Architecture...
> Goal: I want to separate my MainWindow out of MainMenu.xib into its own
> .xib: MainView.xib.
>
> 1) I create a new Cocoa Application (not document-based)
>
> 2) I create a MainWindow.xib and MainWindowController.h/.m setting
> appropriately the relationship between them. MainWindowController inherits
> from NSWindowController and follows the proper procedures of fixing the
> "MainWindow" in the init* methods as mentioned in Apple docs. I also set
> the window and delegate
>
> My assumption (based on docs) is that my default or main NIB to be loaded is
> the one that has NSApplication set as the File's Owner. And this should
> remain as MainMenu, to ensure the responders for the Menu's are properly
> registered/set up.
>
> What is the recommended way to move MainWindow in another NIB? Shall I
> instantiate it from applicationDidFinishLaunching? Is there another way
> through interface builder, where one NIB refers to the other, etc?
Instantiating your MainWindowController controller in your Application Delegate's implementation of applicationDidFinishLaunching sounds like a solid approach to implementing this factoring.
Jon Hess
>
> Thank you,
>
> Mark
> _______________________________________________
>
> 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
_______________________________________________
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