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