tom*_*nal 1 iphone xcode objective-c ios xcode5
我正在使用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];
}
Run Code Online (Sandbox Code Playgroud)
这会让我陷入黑屏.在stackoverflow上搜索我发现2013年2月的这篇帖子建议使用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];
}
Run Code Online (Sandbox Code Playgroud)
但是,这给了我一个错误
Storyboard()不包含标识符为"MPDetailPageViewController"的视图控制器
我试图弄清楚如何查找/设置标识符并看到帖子引用Storyboard ID,但当我在屏幕上看时我只看到Restoration ID,我只能看到当我点击View而不是它ViewController自己.当我点击它时ViewController,我看不到Restoration ID也没有Storyboard ID
任何帮助将不胜感激!
and*_*oft 17
该Storyboard ID属性可以Identity Inspector在View Controller中找到:
Identity Inspector在右边打开.当Utilities窗格打开时,它是顶部的第三个图标.Identity Inspector标有"身份".列出的第一个属性是Storyboard ID.您可以将其值设置为"MPDetailPageViewController".编辑:添加屏幕截图:

| 归档时间: |
|
| 查看次数: |
10381 次 |
| 最近记录: |