我在我的項目中只使用xib文件。現在我需要一個設置視圖的靜態tableview。我想結合xib和一個故事板(用於tableview)。在現有的XIB項目中添加故事板
我在我的項目中添加了一個視圖控制器的故事板。比我爲這個viewcontroller添加一個標識符(SettingsView)之後。當按下該按鈕時,執行以下代碼:
SettingsView *CustomViewController = [[UIStoryboard storyboardWithName:@"Storyboard" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"SettingsView"];
[self presentModalViewController:CustomViewController animated:YES];
我的應用程序崩潰時,我按下設置按鈕:
*終止應用程序由於未捕獲的異常「NSInvalidArgumentException」,原因:' Storyboard()不包含標識符爲'SettingsView'的視圖控制器'
您是否設置了故事板標識符「SettingsView」? –
我設置了viewcontroller的標識符(它位於故事板中)。 標識符:Storyboard ID – NoBody