繁体   English   中英

iOS 开发:如何在启动时加载不同的 XIB

[英]iOS Development: How to Load a Different XIB on Start

我想知道当我的应用程序最初加载时如何加载不同的 XIB。 现在,当我的应用程序加载时,我只是得到一个黑屏,因为没有 MainWindow.xib。 理想情况下,我想加载一个内部有 UINavigationController 的 XIB。 有谁知道如何做到这一点? 提前致谢!

applicationDidFinishLaunching你可能会想到类似

UINavigationController* navigationController = [[UINavigationController alloc] init];

UIViewController *controller = [[UIViewController alloc] initWithNibName:@"First" bundle:nil];
[ navigationController pushViewController:controller animated:NO];
[controller release];

[window addSubview:navigationController.view];
[window makeKeyAndVisible];

当然,这实际上取决于您打算做什么...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM