Re: Loading a nib for a new window
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.