awakeFromNib and loadView execute for different instances

Posted by Kamchatka on Stack Overflow See other posts from Stack Overflow or by Kamchatka
Published on 2010-05-01T17:52:57Z Indexed on 2010/05/01 17:57 UTC
Read the original article Hit count: 267

Hi,

I'm trying to understand why:

NSLog(@"self = %p", self);

in awakeFromNib prints a different value than the same NSLog in viewDidLoad?

This isn't a huge problem because I don't need the awakeFromNib but I would like to understand how it works.

The code that creates the controller is the following:

    MyViewController *myViewController = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil];
    myViewController.image = tmpImage;
    [self.navigationController pushViewController:myViewController animated:YES];
    [myViewController release];

Thanks for any advices!

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk