微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

swift – 无法在Xcode 6.1中连接故事板中的自定义协议委托

我刚刚将我的mac升级到10.10,将 Xcode升级到6.1,

发现一个关于故事板的奇怪的事情,

我的情况是使用swift项目,无法再从故事板连接自定义协议委托.

老版Xcode附带的旧连接很好,但我再也无法连接任何新的代理了.

一旦我移除了连接,我甚至无法重新连接旧的.

有没有人出现这种情况?

==============================更新=================== ===========

View Class

@objc public protocol VideoViewResizeDelegate {

    func shouldVideoViewResetLayout(videoView: GvVideoView) -> Bool;

}

@IBOutlet var resizeDelegate: VideoViewResizeDelegate?;

ViewController Class

@IBDesignable public class ViewController: UIViewController,VideoViewResizeDelegate {

...

}

解决方法

https://developer.apple.com/library/ios/releasenotes/DeveloperTools/RN-Xcode/Chapters/Introduction.html#//apple_ref/doc/uid/TP40001051

Interface Builder

Interface Builder does not support connecting to an outlet in a Swift
file when the outlet’s type is a protocol. Declare the outlet’s type
as AnyObject or NSObject,connect objects to the outlet using
Interface Builder,then change the outlet’s type back to the protocol.
(17023935)

这很糟糕……

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐