Multiple nibs for 1 window?
Multiple nibs for 1 window?
- Subject: Multiple nibs for 1 window?
- From: Clyde McQueen <email@hidden>
- Date: Thu, 1 Nov 2001 06:41:09 -0800
I'd like to be able to load/unload nibs (each nib has a view loaded with
controls) and connect them somehow to an existing window and window
controller. I guess I'm still missing some understanding of IB and nibs,
because my simple experiments haven't worked. Any clues?
In this example, littlenib.nib's File's Owner is a MyController, and
there's a connection from File's Owner test1 to an edit box.
@interface MyController : NSWindowController
{
IBOutlet id test1; // Littlenib control
}
- (void)windowDidLoad;
@end
@implementation MyController
// Called when my main nib loads.
- (void)windowDidLoad
{
// Now load the 2nd nib.
BOOL loaded = [NSBundle loadNibNamed:@"littlenib" owner:self];
NSLog(@"loaded is %d", loaded); // Always loads correctly.
// Now test1 will be non-nil, right?
NSLog(@"test1 is %@", test1); // Always shows up as nil.
}
@end
Any / all help is appreciated.
/Clyde