作者:加勒比海盗的骷髅_829 | 来源:互联网 | 2023-05-19 18:05
IhadcodethatwasworkinginXCode6betabutstoppedworkingrecentlyafterupdatingtoxcode6.1
I had code that was working in XCode 6 beta but stopped working recently after updating to xcode 6.1.
我的代码在XCode 6测试版中有效,但在更新到xcode 6.1后最近停止了工作。
This is my protocol:
这是我的协议:
protocol CanDeserialiseFromJson {
class func FromJson(json : JSONValue) -> Self
}
This is implementation:
这是实施:
extension Invoice : CanDeserialiseFromJson {
class func FromJson(json : JSONValue) -> Self {
return Invoice()
}
}
This fails giving error:
这没有给出错误:
'Invoice' is not convertable to 'Self'
As I said, this used to work and I can't work out why it doesn't anymore
正如我所说,这曾经工作,我无法解决为什么它不再
2 个解决方案