gpt4 book ai didi

iOS 开发 : How to Load a Different XIB on Start

转载 作者:行者123 更新时间:2023-11-28 23:16:09 25 4
gpt4 key购买 nike

我想知道如何在我的应用程序最初加载时加载不同的 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];

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

关于iOS 开发 : How to Load a Different XIB on Start,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6313658/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com