我想知道什么是在AppDelegate.m方法initWithNibname:(NSString *)nibName中的nibName?什么是和如何获得nibName在“AppDelegate - > rootViewController = initWithNibName(NSString *)nibName”
它是如何工作的?
我需要在ViewController中的viewDidLoad方法中使用rootViewController吗?
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
_tonten = [[TontenViewController alloc] init];
//- I'm not sure about this either.
self.window.rootViewController = [[TontenViewController alloc] initWithNibName:@"tontenViewController" bundle:nil];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
感谢您的关注和帮助!
我想,你的笔尖名称可能是'TontenViewController'。检查笔尖名称的案例感。 – Mani