Re: viewDidLoad not called for an NSViewController's subclass (separate XIB)
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