目前的视图控制器ios7

时间:2014-05-19 15:47:28

标签: ios7 xcode5 presentviewcontroller

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

 - (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已分配标识符“privacy”。

但是我收到了这个错误:

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

1 个答案:

答案 0 :(得分:0)

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

我会尝试这个

- (IBAction)showChart:(id)sender {

woundViewController *privacy = [[woundViewController alloc]init];
// present
[self presentViewController:privacy animated:YES completion:nil];
}