• 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
Re: viewDidLoad not called for an NSViewController's subclass (separate XIB)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: viewDidLoad not called for an NSViewController's subclass (separate XIB)


  • Subject: Re: viewDidLoad not called for an NSViewController's subclass (separate XIB)
  • From: Ken Thomases <email@hidden>
  • Date: Sun, 25 Oct 2015 02:12:22 -0500

On Oct 25, 2015, at 1:58 AM, Nick <email@hidden> wrote:

> I am having a weird problem that viewDidLoad isn't called. Actually it's
> not a problem - I can use -awakeFromNib initializator instead, but I am
> wondering why viewDidLoad is not called (as it is automatically generated
> by xcode with a comment "place your initialization code here", when I
> create a new View Controller with a XIB)?

> - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
>
>    myVC = [[MyVC alloc] initWithNibName:@"MyVC" bundle:nil];
>
>    [myVC loadView];
>
>    self.window.contentView = myVC.view;
> }

From the docs for -[NSViewController loadView]:

"Do not call this method. If you require this method to be called, access the view property."

So, why are you calling -loadView?

Regards,
Ken


_______________________________________________

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: viewDidLoad not called for an NSViewController's subclass (separate XIB)
      • From: Nick <email@hidden>
References: 
 >viewDidLoad not called for an NSViewController's subclass (separate XIB) (From: Nick <email@hidden>)

  • Prev by Date: viewDidLoad not called for an NSViewController's subclass (separate XIB)
  • Next by Date: Re: viewDidLoad not called for an NSViewController's subclass (separate XIB)
  • Previous by thread: viewDidLoad not called for an NSViewController's subclass (separate XIB)
  • Next by thread: Re: viewDidLoad not called for an NSViewController's subclass (separate XIB)
  • Index(es):
    • Date
    • Thread