ios - 展开两个 segue

标签 ios iphone swift segue

我的应用程序(相关部分)的定义:

我的 View 中有 map (MAP)。用户单击一个 View ,应用程序反向地理编码以获取地址并转到另一个 View (PICKER),它允许用户从选择器中选择她想要的地点名称或转到另一个 View 并提供自定义名称 (CUSTOM)。

Storyboard of the app

问题是,当我尝试从 CUSTOM 中解脱时,它失败了。

在自定义中,我使用与 MAP Controller 中的 PICKER 相同的方法,即

@IBAction func unwindCancel(segue:UIStoryboardSegue) {
    // do nothing as saving was cancelled
    return
}

@IBAction func unwindSave(segue:UIStoryboardSegue) {
    self.reloadGeodesics()
}

下面我展示了我是如何在 Storyboard中展开的,即按住 ctrl 键拖动取消(并保存)退出并选择相应的 Action 继续。

This is my action segue

这些是我的错误信息

2015-11-02 14:58:59.753 via[19620:2883125] -[via.LocationNamePickerViewController unwindSave:]: unrecognized selector sent to instance 0x7bb35770

2015-11-02 14:58:59.789 via[19620:2883125] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[via.LocationNamePickerViewController unwindSave:]: unrecognized selector sent to instance 0x7bb35770'

当我点击保存时。 via 是我的应用名称,LocationNamePickerViewController 是 PICKER 的 Controller 。 我看了很多教程,对我来说,我似乎做的一切都是对的。

这是错误的从PICKER中的Other到CUSTOM进行segue的问题吗? MAP 和 PICKER 之间的导航 Controller 是否会使编译器崩溃?从错误看来,PICKER 的 Controller 无法将操作 segue 调用委托(delegate)给 MAP 的 Controller 。这会发生吗?如果发生,如何解决?在 PICKER 中一切正常,问题在于展开 CUSTOM。

最佳答案

你创建unwind segue的方式不对,你应该这样创建segue

Control + 从 Location Enter VC 拖动到 Map Exit

动图

关于ios - 展开两个 segue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33478484/

相关文章:

ios - 应用程序大小不正确 iOS 8 iPhone 模拟器

swift - 在分配仍然有效的情况下重置区域分配器

ios - 检测 UITableViewCell 何时加载

ios - Swift 如何从 View Controller 运行函数并更改 SKScene 中的变量?

ios - CGImage裁剪不给指定的矩形

iphone - 在iPhone中长时间在后台运行应用程序

ios - Xcode 8 beta 4 中的 shouldAutorotate() 函数

ios - 从嵌入在 tableView 中的 collectionView 显示 xib

iphone - 在 IOS-5 中获取 twitter 帐户列表并使用 TWTweetComposeViewController 使用它

iphone - 从 UILongPressGestureRecognizer 上的表格 View 单元格保存数据