那么针对这个问题的回答是:Xcode 6 Storyboard Unwind Segue 与 Swift 未连接退出 https://stackoverflow.com/questions/24029586/xcode-6-storyboard-unwind-segue-with-swift-not-connecting-to-exit
我遇到了同样的问题,并尝试了所提供的修复方法,但仍然不起作用。我感觉我的头文件缺少一个步骤,是否足以简单地将 .h 文件添加到我的项目并添加提到的行?或者还有更多的事情吗?
IndexViewController.h:
@interface IndexViewController (Workaround)
- (IBAction)blaat: (UIStoryboardSegue *)segue;
@end
IndexViewController.swift:
@objc(IndexViewController) class IndexViewController : UITableViewController {
@IBAction func blaat(segue : UIStoryboardSegue) {
println("Test");
}
}
Edit1:我完成了步骤 3,即取消设置并重新设置 StoryBoard 中 IndexViewController 实例的自定义类
Edit2:已修复,问题确实在标题中。 IndexViewController.h 应该是:
@class IndexViewController;
@interface IndexViewController : UITableViewController
- (IBAction)unwindToIndexViewController: (UIStoryboardSegue *)segue;
@end
您缺少第 3 步:在 IB 检查器中清除视图控制器类并将其设置回来。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)