我做了一個單視圖項目與故事板,添加了幾個viewcontrollers。 初始的ViewController具有簡單的按鈕,以顯示另一個的ViewControllerpresentViewController不存在
- (IBAction)doPhotoAlbumBtn:(id)sender {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main.storyboard"
bundle:nil];
VCDecorations *ieVC =
[storyboard instantiateViewControllerWithIdentifier:@"VCDecorations"];
[self presentViewController:ieVC animated:NO completion:nil];
}
我導入的類,連接在IB向右類biecontroller,對的ViewController的權利識別符,並檢查了「使用故事板ID」複選框 ,我覺得我缺少很基本的smth。 幫助我們。 謝謝。
嘗試[self storyboard]而不是UIStoryboard。 –
您是否已將「Storyboard ID」值設置爲chekbox上方的VCDecorations? – null
您可以在使用故事板時使用segue。在這種情況下,您可以使用segue,然後使用prepareforSegue方法從第一個控制器繼續使用segue。 –