I have a document-based application which users a placeholder view that loads a view from MyDocument.nib. When the application loads the window is blank. I want to be able to view the default view when i start up the application, any ideas?
- (void)setDocumentView:(id)sender {
NSView *view = documentPlaceholderView;
if (sender) {
NSString *identifier = [sender itemIdentifier];
if ([identifier isEqualToString:SQLViewToolbarItem])
view = sqlModeView;
else if ([identifier isEqualToString:TSDataViewToolbarItem])
view = dataModeView;
else;
}
NSWindow *window = [self window];
if ([window contentView] == view)
return;
NSRect windowRect = [window frame];
[view setHidden:YES];
[window setFrame:windowRect display:YES animate:NO];
[window setContentView:view];
[view setHidden:NO];
}
I tried to use the awakeFromNib method to load this by calling [ApplicationController setDocumentView:SQLViewToolbarItem]; but this didn't work. Then I tried to use windowDidLoad and that didn't work...
I can't figure it out.
Thanks,
Rick