- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我目前正在学习来自 Apple's Start Developing iOS Apps 的教程.
在教程: Storyboard页面(上面的链接)上,我被告知要为两个 View 创建自定义类。为简单起见,我将它们称为 TableView (有一个表)和添加 View (有一个用于向表中添加项目的文本字段)。
Table View 有一个链接打开 Add View 的按钮,Add View 的导航栏上有两个按钮:Cancel 和 Done。
我被告知在添加 View 的 .m 文件中编写一个空方法 unwindToList
:
- (IBAction)unwindToList:(UIStoryboardSegue *)segue
{
}
然后我被告知将“取消”和“完成”按钮都链接到 Scene Dock 中的“退出”项(见底部图像),并选择方法 unwindToList
。因此,正如教程中所引述的那样,这就是应该发生的情况:
Now, run your app. At launch, you see a table view—but there’s no data in it. You can click the Add button and navigate to [the Add View] from [the Table View]. You can click the Cancel and Done buttons to navigate back to [the Table View]."
但是,当我单击“取消”或“完成”时,什么也没有发生。我确定两者都有关联。
提前致谢!
最佳答案
如果您仔细阅读本教程,您会发现展开方法需要在您展开到的UIViewController
中 - 来自教程 -
An unwind segue is created by adding an action method to the destination view controller (the view controller you want to unwind to).
...
Because you want to unwind back to XYZToDoListTableViewController, you need to add an action method with this format to the XYZToDoListTableViewController interface and implementation.
因此,您应该在 TableView Controller 中创建您的 unwindToList
方法,而不是在添加 View Controller 中。
关于ios - 放松 segue 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23721818/
这是我的情况。 我有三个 View Controller ,Root、Pushed 和 Leaf。 Root 是栈中最低的。 “Pushed”被一个 push segue 插入了。 “Leaf”通过模
我正在做一个应用程序,它使用 TableViewController 和一个添加/编辑项目的系统,使用相同的 View 。 (但是,当您添加一个项目时, View 会以模态呈现,并且在您编辑它时会显示
我目前正在学习来自 Apple's Start Developing iOS Apps 的教程. 在教程: Storyboard页面(上面的链接)上,我被告知要为两个 View 创建自定义类。为简单起
问题: 放松转场而不是关闭 View ,即使它有效。 场景: 我有一个“添加产品”屏幕,当添加产品时,我会启动 unwind segue,这又会显示一个弹出窗口:“已添加新产品”。 事实:1) 产品成
我已经根据这个 question 的答案成功地实现了一个 unwind segue 我无法开始工作的是使用 BarButton Item 来触发展开,而不是 Button。 Button 项正确触发了
关闭。这个问题是opinion-based .它目前不接受答案。 想要改进这个问题? 更新问题,以便 editing this post 可以用事实和引用来回答它. 关闭 1 年前。 Improve
我有一个 User 类,我想授权访问,这样只有用户才能看到他有权访问的内容。 使用 Spring Security 和 Spring Data Rest 很容易实现这一点,在 JPA Reposito
对于初学者 - 我使用 Swift 3 和 Xcode 8。 我熟悉各种可能性,如何从 StoryBoard 或以编程方式(例如,在 UIButton 上单击)执行“unwind segue”。但我很
当 Storyboard上有一个按钮连接退出时,我了解如何使用展开转场。但是在我的应用程序中,我使用推送转场从 TableViewController 转到 ViewController。所以我的导航
我要实现的目标的背景: MainViewController 呈现 TableVC。我将点击一个单元格以显示 DetailVC。能够通过 TableVC 或 DetailVC 上导航栏上的 doneB
我是一名优秀的程序员,十分优秀!