I'm using the great Sync from HyperOslo to get a JSON object from an API:
JSON object:
{"user":
{"name" : "damien",
"email" : "myemail@gmail.com",
"settings" :
{ "notification" : "true",
"secretKey" : "dzadd7z5a7dzd5azd"
}
}
}
this is my User object, subclassing NSManagedObject. with the property "settings" as a custom NSObject:
class User: NSManagedObject {
@NSManaged var name: String?
@NSManaged var email: String?
@NSManaged var settings: Settings?
}
this looks impossible! (if something know an other third party framework?)
as the doc, the solution would be to use the Binary Data Type:
... but how build the getter of this property in my model? (i know the getter below has any sense):
@NSManaged var settings: Settings?{
return [NSKeyedUnarchiver unarchiveObjectWithData:self.settings];
}