gpt4 book ai didi

iOS/xcode/objective-c : How to instantiate view controller after signup

转载 作者:行者123 更新时间:2023-11-28 21:39:12 25 4
gpt4 key购买 nike

成功注册后,我希望用户完成提供照片等的过程。与下面类似的代码可以加载登录页面,但下面的代码无法在 Storyboard“newuser”中加载单独的 View Controller ”。

如有任何修复建议,我们将不胜感激。

- (void)presentNewUserInterface
{
UIViewController* rootController = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"newuser"];
UINavigationController* navigation = [[UINavigationController alloc] initWithRootViewController:rootController];
self.window.rootViewController = navigation;
}

最佳答案

代替:

- (void)presentNewUserInterface
{
UIViewController* rootController = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"newuser"];
UINavigationController* navigation = [[UINavigationController alloc] initWithRootViewController:rootController];
self.window.rootViewController = navigation;
}

尝试:

- (void)presentNewUserInterface
{
UIViewController* rootController = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"newuser"];
UINavigationController* navigation = [[UINavigationController alloc] initWithRootViewController:rootController];
[self presentViewController:navigation animated:YES completion:nil];
}

您没有在示例中展示新的导航 Controller 。您尝试更换 rootViewController 是否有特殊原因?那不应该是必需的。我的示例应该足以显示您在用户注册过程中的下一个流程。

关于iOS/xcode/objective-c : How to instantiate view controller after signup,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32745715/

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