gpt4 book ai didi

ios - 第一个 iPad 应用程序 : Facing Problems

转载 作者:行者123 更新时间:2023-12-01 18:30:18 24 4
gpt4 key购买 nike

我试图通过在 AppDelegate 中调用它来获取拆分 Controller 的 View ,但它没有显示出来。这是写在 didfinishlaunchwithoptions 中的代码:

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.

SplitViewController *splitViewController = [[SplitViewController alloc] initWithNibName:@"SplitViewController" bundle:nil];
self.navigationController = [[UINavigationController alloc] initWithRootViewController:splitViewController];
self.window.rootViewController = self.navigationController;
[self.window makeKeyAndVisible];
return YES;

我有SplitViewController.xib, View 为红色。但 iPad 模拟器出现黑屏。

请看看可能是什么问题。

谢谢

最佳答案

Split View Controllers cannot be pushed to a Navigation Controller



这是这里的关键。尝试将您的 Split View Controller 直接添加到您的窗口。
self.window.rootViewController = self.splitViewController;

关于ios - 第一个 iPad 应用程序 : Facing Problems,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9755835/

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