Open drulang opened 9 years ago
Sounds like valid proposition. Mind submitting a PR?
If you're using AFNetworking and you're using AFHTTPSessionManager to make your calls, you can do this:
_manager = [[AFHTTPSessionManager alloc] initWithBaseURL:url];
AFJSONResponseSerializer *responseSerializer = [AFJSONResponseSerializer serializer];
[responseSerializer setRemovesKeysWithNullValues:YES];
_manager.responseSerializer = responseSerializer;
This will remove keys that have null values. Then your models should use the default values since the keys with null values are no longer there.
Hey,
Just wondering if Realm-JSON can use a property's default value instead of trying to assign NSNull to the property which is causing Realm to crash?
Thanks! Dru