提问人:UnAvailable404 提问时间:9/25/2021 最后编辑:UnAvailable404 更新时间:9/25/2021 访问量:35
无法在 iOS 应用程序中初始化 UINavigationController
Unable to initialize UINavigationController in an iOS application
问:
我的应用程序具有以下设计:
[Information view (UIViewController)] >
[Login/Signup View (UINavigationController)]
在信息视图将基本信息传送到用户屏幕后,我使用以下代码将 Login/SignUp 视图初始化为根 UINavigationController 并将其显示在用户的屏幕上。
loginViewController *loginVC = [[loginViewController alloc] init];
UINavigationController *loginNVC = [[UINavigationController alloc] initWithRootViewController:loginVC];
loginVC.modalPresentationStyle=UIModalPresentationFullScreen;
loginVC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self showViewController:loginVC sender:self];
但是在运行应用程序时,Xcode 显示“不支持推送导航控制器”,并指向以下代码块:
UINavigationController *loginNVC = [[UINavigationController alloc] initWithRootViewController:loginVC];
初始化 UINavigationController 的方式不正确吗?
AppDelgate 代码:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
ViewController *rootVC = [[ViewController alloc] init];//ViewController == Information View
self.window.rootViewController=rootVC;
[self.window makeKeyAndVisible];
return YES;
}
答: 暂无答案
评论