我有一個視圖控制器我放在主故事板,但當我嘗試初始化並加載視圖控制器時,我的應用程序崩潰。我使用的xcode版本並沒有真正告訴我我得到的錯誤,但我確實看到它給了我一個sigabrt信號。我不知道它爲什麼不起作用。試圖從故事板初始化視圖控制器
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];
UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"SelectDateViewController"];
[vc setModalPresentationStyle:UIModalPresentationFullScreen];
[self presentModalViewController:vc animated:YES];
這就是我所說的。我用的所有名字都是正確的,但我仍然不明白爲什麼它會崩潰。
當您創建的應用程序,你讓故事板開始? – erdekhayser
@foriinrangeawesome是的,我做到了。 –