• 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
Multiple nibs for 1 window?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Multiple nibs for 1 window?
      • From: "Erik M. Buck" <email@hidden>
  • Prev by Date: RE: Book
  • Next by Date: Re: Book
  • Previous by thread: problem with NSArray in a NSTableView
  • Next by thread: Re: Multiple nibs for 1 window?
  • Index(es):
    • Date
    • Thread