Loading View in Placeholder upon startup
Loading View in Placeholder upon startup
- Subject: Loading View in Placeholder upon startup
- From: Rick Langschultz <email@hidden>
- Date: Sun, 25 Nov 2007 21:25:14 -0600
Hello everyone,
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?
Here is my code to update the view:
- (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
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden