RootViewController *rvController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:[NSBundle mainBundle]];
有时我看到它使用 nil,我不知道它到底有什么用?
这是确切的解释:
要在其中搜索的包
笔尖文件。该方法寻找
捆绑包中的 nib 文件
特定于语言的项目目录
首先是资源,其次是资源
目录。如果nil,这个方法看起来
主包中的 nib 文件。
我认为 [NSBundle mainBundle] 没有做任何与你输入 nil 不同的事情。但是,如果你想做国际化和本地化,你可以使用它们
更多详情请点击这里 http://developer.apple.com/iphone/library/documentation/uikit/reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instm/UIViewController/initWithNibName:bundle:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)