• 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
What are the finer points to programatically loading a view from a NIB and attaching to the default window in MainMenu.xib?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What are the finer points to programatically loading a view from a NIB and attaching to the default window in MainMenu.xib?


  • Subject: What are the finer points to programatically loading a view from a NIB and attaching to the default window in MainMenu.xib?
  • From: "Michael A. Crawford" <email@hidden>
  • Date: Tue, 21 Jul 2009 00:28:19 -0400

I've tried the following but I get no output (the view is blank).

- (void)awakeFromNib
{
ndViewController = [[NDViewController alloc] initWithNibName:@"NDView" bundle:nil];
#if 1
[window.contentView addSubview:ndViewController.view];
#else
[window setContentView:ndViewController.view];
#endif
}


The NIB file is loaded in that I was able set a breakpoint on - [awakeFromNib] for the NDView class. Yet, I don't see any output. If I remove the controller and use IB to add the NDView to the window as a custom-view. I can see the view and works fine. I've tried both the -[setContent] -[addSubview] calls.

Perhaps someone can point to a sample or has a check-list of steps to take when manually loading views from nibs and attaching them to existing windows?

Thanks.

-Michael

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: What are the finer points to programatically loading a view from a NIB and attaching to the default window in MainMenu.xib?
      • From: Quincey Morris <email@hidden>
    • Re: What are the finer points to programatically loading a view from a NIB and attaching to the default window in MainMenu.xib?
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: NSTextView help
  • Next by Date: Re: What are the finer points to programatically loading a view from a NIB and attaching to the default window in MainMenu.xib?
  • Previous by thread: Re: NSTextView help
  • Next by thread: Re: What are the finer points to programatically loading a view from a NIB and attaching to the default window in MainMenu.xib?
  • Index(es):
    • Date
    • Thread