0

我正在使用 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 具有分配给它的标识符“隐私”。

但我收到此错误:

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

1 回答 1

0

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

我会试试这个

- (IBAction)showChart:(id)sender {

woundViewController *privacy = [[woundViewController alloc]init];
// present
[self presentViewController:privacy animated:YES completion:nil];
}
于 2014-05-19T16:13:55.777 回答