• 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: Loading a nib for a new window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loading a nib for a new window


  • Subject: Re: Loading a nib for a new window
  • From: Jeremy Dronfield <email@hidden>
  • Date: Thu, 11 Jul 2002 11:40:39 +0100

Having your menu item call the following method should work:

- (void)launchMyNibAndOpenItsWindow // or whatever
{
myObject = [[MyObject alloc] initWithWindowNibName:@"NameOfMyObjectsNibFile"]; // without .nib extension
[myObject showWindow:self];
}

with the accessor method:

- (MyObject *)myObject {
return myObject;
}

If you're already doing this and it doesn't work, make sure your window is connected to the window outlet of its controller in Interface Builder.

Hope this helps
- Jeremy

On Thursday, July 11, 2002, at 06:04 am, Andrew Merenbach wrote:

I'm working on a program with one main window and about twenty other windows (each of which is accessed from both a popup menu and a menu in the menu bar). Each window is in a separate nib file for ease of maintenance. I would like some guidance as to what I should do from there. From what I've read so far it looks like I should be loading the nibs dynamically, but that's all I can figure out. I've tried implementing initWithWindowNibName, and from there showWindow, but I must not have the syntax right. Can someone provide me with an example (or a URL to an example) of this specific concept?

Thanks in advance,
Andrew Merenbach
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Loading a nib for a new window (From: Andrew Merenbach <email@hidden>)

  • Prev by Date: Re: NSTextView - changing font size
  • Next by Date: NSView and performance drawing again. A Result!
  • Previous by thread: Loading a nib for a new window
  • Next by thread: Re: Loading a nib for a new window
  • Index(es):
    • Date
    • Thread