我有一个放置在主故事板中的视图控制器,但是当我尝试初始化和加载视图控制器时,我的应用程序崩溃了。我使用的 xcode 版本并没有真正告诉我正确得到的错误,但我确实看到它给了我一个 sigabrt 信号。我不知道为什么它不起作用。
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];
UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"SelectDateViewController"];
[vc setModalPresentationStyle:UIModalPresentationFullScreen];
[self presentModalViewController:vc animated:YES];
我就是这样称呼它的。我使用的所有名称都是正确的,但我仍然不明白它为什么会崩溃。