On Oct 25, 2015, at 1:58 AM, Nick <[email protected]> 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 protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to