【问题标题】:present view controller ios7当前视图控制器 ios7
【发布时间】:2014-05-19 15:47:28
【问题描述】:

我正在使用 tabBarVC 并在其中一个 tabviews 中我想呈现一个视图。我添加了一个按钮。添加此代码:

 - (IBAction)showChart:(id)sender {

    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    woundViewController *privacy = (woundViewController*)[storyboard     instantiateViewControllerWithIdentifier:@"privacy"];

    // present
    [self presentViewController:privacy animated:YES completion:nil];

}

我要展示的新 VC 具有分配给它的标识符“隐私”。

但我收到此错误:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[flipSideViewController _setViewDelegate:]: 

【问题讨论】:

    标签: ios7 xcode5 presentviewcontroller


    【解决方案1】:

    我认为这是您设置视图控制器的方式,当前代码看起来正确。

    我会试试这个

    - (IBAction)showChart:(id)sender {
    
    woundViewController *privacy = [[woundViewController alloc]init];
    // present
    [self presentViewController:privacy animated:YES completion:nil];
    }
    

    【讨论】:

    • 这使它没有抛出错误,但它没有呈现我在主中设置的视图。它呈现了一个黑屏。我希望它来自woundVC => flipsideVC
    猜你喜欢
    • 2021-11-12
    • 1970-01-01
    • 2016-01-03
    • 2012-02-19
    • 1970-01-01
    • 2019-07-03
    • 1970-01-01
    • 2015-07-23
    • 1970-01-01
    相关资源
    最近更新 更多