mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-24 04:46:01 +08:00
Allow modification of the data in objectLoader:willMapData: by creating a mutable copy of the parsed data if the delegate method is implemented.
This commit is contained in:
@@ -58,7 +58,8 @@
|
||||
/**
|
||||
Invoked just after parsing has completed, but before object mapping begins. This can be helpful
|
||||
to extract data from the parsed payload that is not object mapped, but is interesting for one
|
||||
reason or another.
|
||||
reason or another. The mappableData will be made mutable via mutableCopy before the delegate
|
||||
method is invoked.
|
||||
*/
|
||||
- (void)objectLoader:(RKObjectLoader*)loader willMapData:(id)mappableData;
|
||||
|
||||
|
||||
@@ -131,6 +131,7 @@
|
||||
}
|
||||
|
||||
if ([self.delegate respondsToSelector:@selector(objectLoader:willMapData:)]) {
|
||||
parsedData = [[parsedData mutableCopy] autorelease];
|
||||
[(NSObject<RKObjectLoaderDelegate>*)self.delegate objectLoader:self willMapData:parsedData];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user