这比班级还低
class User: NSManagedObject {
@NSManaged var id: Int
@NSManaged var name: String
}
需要转换为
{
"id" : 98,
"name" : "Jon Doe"
}
I tried manually passing the object to a function which sets the variables into a dictionary and returns the dictionary. But I would want a better way to accomplish this.