Closed sambong0113 closed 4 years ago
Not as such, but you could just do
@NSManaged public var identifier: Int? // The Int identifier you're using
@objc public var identifierAsString: String? { // A computed property to transform Int<->String
get {
return identifier != nil ? String(identifier!) : nil
}
set {
identifier = newValue != nil ? Int(newValue!) : nil
}
}
public static func primaryKey() -> String {
return "identifierAsString"
}
I just try that code, but it returns nil error in that function.
The originalObject is nil because of NSPredicate fail.
Is there any possible way to fix it?
Ah right, can't fetch on a computed property :/
I think it would be possible to support Int identifiers as well, but if you want to use the library in the meantime you would have to add a String type identifier to your objects.
I'm using primary key to id type of Int64. If that it return nil because of failing String converting.
Is there any way to use primary key type of Int?