有人能解释一下为什么使用loadView时viewDidLoad不会被调用吗? 据我所知,viewDidLoad仍然应该被调用。
- (void)loadView
{
CGRect currentFrame = [[UIScreen mainScreen] applicationFrame];
UIView* myView = [[UIView alloc] initWithFrame:CGRectMake(currentFrame.origin.x, currentFrame.origin.y, currentFrame.size.width, currentFrame.size.height)];
myView.backgroundColor = [UIColor redColor];
self.view = myView;
[myView release];
[super loadView];
}
- (void)viewDidLoad {
//this never happens
NSLog(@"VIEW DID LOAD!");
[super viewDidLoad];
}