【问题标题】:Change UIView to another one in MainStoryboard在 MainStoryboard 中将 UIView 更改为另一个
【发布时间】:2012-09-18 13:43:44
【问题描述】:

我有一个基于标签的应用程序,其中某些部分适用于所有人,但用户应该注册才能访问,所以,我想将 UIView 更改为 Login 的。

登录视图分配在 MainStoryboard 的第一个选项卡中

现在我在另一个选项卡,另一个部分(已经有一个 .xib 文件),我想显示“登录”视图:

 Login *aLogin = [[Login alloc] initWithNibName:@"LOGIN" bundle:nil];
 [self presentModalViewController:aLogin animated:YES];

但由于 LOGIN xib 不存在而崩溃。

 Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 

如何加载“登录”uiview?

谢谢!

【问题讨论】:

    标签: objective-c uiview


    【解决方案1】:

    我找到了!

     UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
     Login *aLogin = [storyboard instantiateViewControllerWithIdentifier:@"Login"];
     [self presentModalViewController:aLogin animated:YES];
    

    【讨论】:

    • 我不能!当我写答案时,我必须等待 2 天!
    猜你喜欢
    • 1970-01-01
    • 2017-09-02
    • 1970-01-01
    • 1970-01-01
    • 2020-08-25
    • 1970-01-01
    • 2019-12-12
    • 2021-06-04
    • 1970-01-01
    相关资源
    最近更新 更多