primaryKey
needs to be a class function which returns the name of the property which is the primary key, not an instance method which returns the value of the primary key.
@objcMembers class Foo: RLMObject {
dynamic var id = 0
dynamic var title = ""
override class func primaryKey() -> String? {
return "id"
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…