mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-01-12 22:51:50 +08:00
Replace [NSNull null] in examples with nil to match current API
This commit is contained in:
@@ -233,7 +233,7 @@ operation.managedObjectCache = managedObjectStore.managedObjectCache;
|
||||
// You can map errors to any class, but `RKErrorMessage` is included for free
|
||||
RKObjectMapping *errorMapping = [RKObjectMapping mappingForClass:[RKErrorMessage class]];
|
||||
// The entire value at the source key path containing the errors maps to the message
|
||||
[errorMapping addPropertyMapping:[RKAttributeMapping attributeMappingFromKeyPath:[NSNull null] toKeyPath:@"errorMessage"]];
|
||||
[errorMapping addPropertyMapping:[RKAttributeMapping attributeMappingFromKeyPath:nil toKeyPath:@"errorMessage"]];
|
||||
|
||||
NSIndexSet *statusCodes = RKStatusCodeIndexSetForClass(RKStatusCodeClassClientError);
|
||||
// Any response in the 4xx status code range with an "errors" key path uses this mapping
|
||||
@@ -257,7 +257,7 @@ RKResponseDescriptor *articleDescriptor = [RKResponseDescriptor responseDescript
|
||||
|
||||
RKObjectMapping *errorMapping = [RKObjectMapping mappingForClass:[RKErrorMessage class]];
|
||||
// The entire value at the source key path containing the errors maps to the message
|
||||
[errorMapping addPropertyMapping:[RKAttributeMapping attributeMappingFromKeyPath:[NSNull null] toKeyPath:@"message"]];
|
||||
[errorMapping addPropertyMapping:[RKAttributeMapping attributeMappingFromKeyPath:nil toKeyPath:@"message"]];
|
||||
NSIndexSet *statusCodes = RKStatusCodeIndexSetForClass(RKStatusCodeClassClientError);
|
||||
// Any response in the 4xx status code range with an "errors" key path uses this mapping
|
||||
RKResponseDescriptor *errorDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:mapping pathPattern:nil keyPath:@"errors" statusCodes:statusCodes];
|
||||
|
||||
Reference in New Issue
Block a user