Can viewDidLoad get called before 'init' of a viewController is fully executed?
What is the full sequence events in terms of how a view controller loaded into memory from init to viewDidLoad?
If you do something like:
TabControllerClass *cc = [[TabControllerClass alloc] initWithCustomData:something];
Can the class's viewDidLoad get invoked before reaching the end of the custom init method, 'initWithCustomData'?
- (id)initWithCustomData:(NSString *)something
{
if (self = [super init])
{
// A bunch of other initialization happens
}
// Would you reach here before 'viewDidLoad' is invoked?
return self;
}
where my TabControllerClass inherits 开发者_运维知识库from UITabBarController.
I assume not. I mean, how can any method be called before the controller is correctly allocated and initialized? However, you may find that your -[ControllerClass initWithCustomData]
initializer isn't the designated initializer, which could explain why it isn't being called.
精彩评论