Is it at all possible to get Core Data to allow assignment of NSNull? I'm using the JSONKit and it defaults to assigning NSNull. I'd prefer to be able to do my deserialization like this:
- (void)deserialize:(NSDictionary *)dictionary
{
self.name = [dictionary objectForKey:@"name"];
}
Instead of like this:
- (void)deserialize:(NSDictionary *)dictionary
{
NSNull *null = [NSNull null];
NSString *value = [dictionary objectForKey:@"name"];
self.name = (value != null) ? value : nil;
}
One thought would be to create a category for NSDictionary. The category could then contain this behavior.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With