• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to open two nibs at app launch ? Beginners question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to open two nibs at app launch ? Beginners question


  • Subject: Re: How to open two nibs at app launch ? Beginners question
  • From: Quincey Morris <email@hidden>
  • Date: Sun, 12 Apr 2009 20:40:06 -0700

On Apr 12, 2009, at 07:49, Mario Kušnjer wrote:

The problem is:
I have MainMenu.xib with only main menu whose File's Owner is NSApplication.
I want to have MainWindow.xib with only a window but that will be launched also when the application starts.


Now you will ask why separate nibs ?
Never mind why ! I just want it that way ! Is that wrong ?

It's not wrong at all. Separate nibs are the recommended way of doing this.


So I read the docs and it says that I need to have File's Owner for that nib that is external to that nib.
I tried putting NSWindowController but I don't know where and how do I instantiate that class ?
I tried creating a subclass of NSWindowController and using it for the File's Owner and according to output of
NSLog everything gets allocated and initialized but window does not get showed.
I starting to think that I should do something in main.m but I don't think that would be the right way.
I am doing something wrong so please point me the right way.

You may just need to tell your window controller to display its window. Trying adding:


	[myWindowController showWindow: nil];

after you've initialized your window controller.

Incidentally, in a non-document-based application (as your appears to be), a good place to put code to create your window controller would be in your application delegate's applicationDidFinishLaunching: method. You say you created a window controller. Where *did* you put that code?


_______________________________________________

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


  • Follow-Ups:
    • Re: How to open two nibs at app launch ? Beginners question
      • From: Mario Kušnjer <email@hidden>
References: 
 >How to open two nibs at app launch ? Beginners question (From: Mario Kušnjer <email@hidden>)

  • Prev by Date: NSDocument reference held by NSSavePanel?
  • Next by Date: Re: stopping an application
  • Previous by thread: How to open two nibs at app launch ? Beginners question
  • Next by thread: Re: How to open two nibs at app launch ? Beginners question
  • Index(es):
    • Date
    • Thread