加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-14 04:29:28 所属栏目:百科 来源:网络整理
导读:我刚刚将我的mac升级到10.10,将 Xcode升级到6.1, 发现一个关于故事板的奇怪的事情, 我的情况是使用swift项目,无法再从故事板连接自定义协议委托. 老版Xcode附带的旧连接很好,但我再也无法连接任何新的代理了. 一旦我移除了连接,我甚至无法重新连接旧的. 有没
我刚刚将我的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)

这很糟糕……

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读