IOS故事板:恢复ID就像故事板ID一样? [英] IOS Storyboards: Restoration ID just like Storyboard ID?

查看:128
本文介绍了IOS故事板:恢复ID就像故事板ID一样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Steinberg的iBook'IOS SToryboards'过渡到使用故事板。在第30页上,作者的教程显示将Identity Inspector中的Storyboard ID设置为redScene的值。在书籍图形中,这显示为识别下的第一个字段

I'm using the iBook 'IOS SToryboards' by Steinberg to transition into using storyboards. On page 30, the author's tutorial shows setting the 'Storyboard ID' in the Identity Inspector, to a value - of redScene. In the book graphic this shows as the first field under 'Identify'

在XCode 4.6.1中我没有看到故事板ID,但我确实看到了一个字段称为恢复ID,我将其设置为值'redScene'。然后我在ViewController.m中使用该值

In XCode 4.6.1 I don't see 'Storyboard ID', but I do see a field called 'Restoration ID', which I set to the value 'redScene'. I then use that value in the ViewController.m

 - (IBAction)redButtonTapped:(id)sender {
     UIViewController *redViewController = [[self storyboard]


 instantiateViewControllerWithIdentifier:@"redScene"];
     [self presentViewController:redViewController animated:YES completion:nil];

 }

然而,当我运行我的应用程序时,我收到错误就在我引用'redScene'的那一行。我设置了一个异常断点,我看到了

However, when I run my app, I get an error right on the line where I refer to 'redScene'. I set an exception breakpoint and I see

(lldb)

我不知道该看什么在左侧调试器显示的值中,但我知道我的代码可能不知道'redScene'是谁。

I'm not sure what to look at in the values displayed by the debugger on the left side, but I have the idea that probably my code doesn't know who 'redScene' is.

我刚开始学习使用苹果文档,但我仍然不确定如何找到正确的阅读区域。我尝试在那里搜索恢复ID和故事板ID,但我没有得到任何结果。

I'm starting to learn to use the apple documentation, but I'm still uncertain about how to locate the right areas to read. I tried searching on both 'restoration id' and 'storyboard id' there, but I don't get any results.

我是否在这篇文章中提供了足够的信息?

Did I put enough information into this post?

感谢您的任何想法

Laurel

推荐答案

我刚刚在故事板上玩了一下,我想我知道你的问题!如果您在故事板上选择视图,则只允许您设置恢复ID。您需要选择完整的视图控制器。您可以通过在故事板面板的左层次结构中选择它,单击该视图控制器上的状态栏或视图下方的黑色底栏来实现此目的。

I just played around in the storyboard for a bit, and I think I know your problem! If you select the view on the storyboard, it will only let you set the Restoration ID. You need to select the full view controller. You can do so by either selecting it in the left hierarchy on the storyboard panel, clicking the status bar on that view controller, or the black bottom bar underneath the view.

这篇关于IOS故事板:恢复ID就像故事板ID一样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆