Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > I can't Load a NIB and open a Window

I can't Load a NIB and open a Window
Thread Tools
Mac Elite
Join Date: Jan 2001
Location: New York
Status: Offline
Reply With Quote
Jun 28, 2004, 08:44 PM
 
-(id)init{
self = [super initWithWindowNibName:@"conWindow"];
return self;
}

-(void)showWindow{
[progWin makeKeyAndOrderFront:self];
NSLog(@"showWindow called");
}


It extends NSWindowController. I haven't don Cocoa for so long! Nothing displays, the outlet is set in IB for progWin and it's defined in interface file.
     
Senior User
Join Date: Feb 2003
Location: USA
Status: Offline
Reply With Quote
Jul 1, 2004, 06:47 AM
 
I'm not sure if the way I do it is by the book, but basically I declare a variable for the second window, as in:

SecondWindowController *secwincontroller;

Then call it up like so:

- (IBAction)showsecondwindow:(id)sender
{
if (secwincontroller == nil) // Check to see if we've already loaded the second window controller
{
secwincontroller = [[SecondWindowController alloc] initWithWindowNibName:@"SecondWindow"];
}
//Now that we have a controller, tell it to show the window
[secwincontroller showWindow:self];

}
(Last edited by techtrucker; Jul 1, 2004 at 06:54 AM. )
MacBook 2.0 160/2GB/SuperDrive
Lots of older Macs
     
davecom  (op)
Mac Elite
Join Date: Jan 2001
Location: New York
Status: Offline
Reply With Quote
Jul 1, 2004, 04:31 PM
 
nm i got it, i wasn't setting file's owner as the class.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:38 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2