UIViewController的-init方法和- (inst
2016-08-03 本文已影响146人
afb399d1a25f
HomePageViewController *homePageViewController = [[HomePageViewController alloc] init];
视图控制器对象的-init方法的内部会自动调用-initWithNibName: bundle:方法
-
(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
[self requestContentForHomePageAtIndex:0];
}
return self;
}