1
我正在研究xcode 5中的一個故事板。我有一個導航控制器,並且正在嘗試建立到故事板中其他場景的轉換。我第一次嘗試使用:instantiateViewControllerWithIdentifier in xcode 5
- (IBAction)handleTap:(UITapGestureRecognizer *)sender {
NSLog(@"Image clicked");
_detailPage = [[MPDetailPageViewController alloc] initWithNibName:@"MPDetailPageViewController" bundle:nil];
_detailPage.product = _curProduct;
//Bring to detail page
[self.navigationController pushViewController:self.detailPage animated:YES];
}
這會把我帶到黑屏。搜索在計算器我發現this post from Feb 2013使用instantiateViewControllerWithIdentifier
這表明所以,我想:
- (IBAction)handleTap:(UITapGestureRecognizer *)sender {
NSLog(@"Image clicked");
_detailPage = [self.storyboard instantiateViewControllerWithIdentifier:@"MPDetailPageViewController"];
_detailPage.product = _curProduct;
//Bring to detail page
[self.navigationController pushViewController:self.detailPage animated:YES];
}
然而,這給了我一個錯誤
故事板()不包含標識符的視圖控制器'MPDetailPageViewController'
我試圖找出如何找到/設置識別呃看到帖子Storyboard ID
,但是當我在屏幕上看時,我只看到Restoration ID
,我只能看到當我點擊View
而不是ViewController
本身。當我點擊ViewController
,我沒有看到Restoration ID
也沒有Storyboard ID
任何幫助將不勝感激!
哦,這是令人尷尬的。我的「身份」部分只是最小化。必須點擊它才能顯示「Storyboard ID」和「Restoration ID」。謝謝你的幫助! – tombornal