I've got a subclass of an NSWindowController that I'm using to load a window from a nib and show it on the screen. Below is the code that is called when I want to show the window. On 10.6 when showCustomWindow is called the window is displayed, but on 10.5 this method has to be called twice to get the window to display.
-(IBAction)showCustomWindow:(id)sender
{
if(!windowController){
windowController = [[MyWindowController alloc] initWithWindowNibName:@"MyWindow"];
}
[windowController showWindow:self];
}
The window has "Visible at Launch" checked and unchecking it didn't seem to make a difference.
Edit: I realized that the problem I was having was not related to my NSWindowController or showWindow. I had that set up correctly. I did however find out that not all classes implement awakeFromNib. In one of my NSView subclasses (that was in the nib I was trying to load), i was calling [super awakeFromNib] which was giving me a "does not respond to selector" (but only on 10.5 which is strange). So, I could have just taken out [super awakeFromNib] but I opted for the hopefully more robust:
if([NSView instancesRespondToSelector:@selector(awakeFromNib)]) {
[super awakeFromNib];
}
That allowed my nib to load normally and showWindow to work properly.