• 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
Loading View in Placeholder upon startup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Loading View in Placeholder upon startup
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Re: Newbie question: NSDocument and standard file formats
  • Next by Date: Subclassing NSTextFieldCell - can't even get started!
  • Previous by thread: Re: IKImageBrowser performance issues
  • Next by thread: Re: Loading View in Placeholder upon startup
  • Index(es):
    • Date
    • Thread