@implementation NVController
//Plain Init method
-(id)init
{
self=[super init];
if(self)
{
}
return self;
}
//CustomInit Method
-(id)initWithRootViewController:(UIViewController *)rootViewController
{
self=[super initWithRootViewController:rootViewController];
if(self)`enter code here`
{
}
return self;
}
@end
NVController *instance=[[NVController alloc] initWithRootViewController:nil];
在上述情况下,由于我只调用initWithRootViwController
,因此还调用了另一个构造函数init
。任何帮助,将不胜感激。