快速展开的解决方法 [英] Workaround for swift unwinding

查看:63
本文介绍了快速展开的解决方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以在回答这个问题时:Xcode 6 Storyboard Unwind Segue 与 Swift 未连接到退出

So in response to this question: Xcode 6 Storyboard Unwind Segue with Swift Not Connecting to Exit

我遇到了同样的问题并尝试了提供的修复程序,但它仍然不起作用.我觉得我的头文件缺少一个步骤,简单地将 .h 文件添加到我的项目并添加提到的行是否足够?或者还有更多吗?

I'm having the same problem and tried the fix presented, but it still doesn't work. I get the feeling that I'm missing a step for my header file, is it sufficient to simple add a .h file to my project and add the lines mentioned? Or is there more to it?

IndexViewController.h:

IndexViewController.h:

@interface IndexViewController (Workaround)
- (IBAction)blaat: (UIStoryboardSegue *)segue;
@end

IndexViewController.swift:

IndexViewController.swift:

@objc(IndexViewController) class IndexViewController : UITableViewController {
@IBAction func blaat(segue : UIStoryboardSegue) {
    println("Test");
} 
}

Edit1:我完成了第 3 步,即取消设置并重新设置 StoryBoard 中 IndexViewController 实例的自定义类

I do complete step 3, which is to unset and re-set the custom class for the instance of IndexViewController in the StoryBoard

Edit2:已修复,问题确实出在标题中.IndexViewController.h 应该是:

Fixed it, the issue was indeed in the header. IndexViewController.h should be:

@class IndexViewController;
@interface IndexViewController : UITableViewController
- (IBAction)unwindToIndexViewController: (UIStoryboardSegue *)segue;
@end

推荐答案

在 Xcode6-Beta 4 中,此错误已得到修复.我在我的一个项目中自己尝试过.升级您的 xcode,您可以忘记解决方法.

In Xcode6-Beta 4 this bug has been fixed. I tried it myself in one of my project. Upgrade your xcode and you can forget the workaround.

这篇关于快速展开的解决方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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