由于将xcode更新为6.3.1,所以收到了此错误消息。
/Users/MNurdin/Documents/iOS/xxxxx/Models/Message.swift:46:10: Method 'hash()' with Objective-C selector 'hash' conflicts with getter for 'hash' from superclass 'NSObject' with the same Objective-C selector
我的密码
var hash_ : UInt
func hash() -> UInt {
return UInt(hash_);
}
详细说明:@property(readonly) NSUInteger hash
是的Objective-C属性NSObject
,这意味着为该变量创建了一个吸气剂hash()
。
现在,您尝试定义一个具有相同名称和相同参数的方法(无),但是具有不同的返回类型(UInt
而不是NSUInteger
,这将是Int
迅速的)。因此,您收到给定的错误。要解决该问题,您现在有两个选择:
Int
->将覆盖预定义的哈希函数本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句