My current project uses AFNetworking 2.2 and in general refuses to compile when I add Restkit. Is there a way for me to get some equivalent of RKObjectMapping as defined below from some other lightweight library? I'm talking about taking JSON and turning it into a custom value object, not just a dictionary or array.
Google GSON for Android comes to mind, is there something like that for iOS?
What' I'm trying to accomplish:
static RKObjectMapping* mapping = nil;
+(RKObjectMapping*)objectMapping
{
if(mapping != nil)
{
return mapping;
}
//allows automatic unpacking of JSON payloads into Value Objects
//https://github.com/RestKit/RestKit/wiki/Object-Mapping
//JSON - VO
mapping = [RKObjectMapping mappingForClass:[MyVO class]];
[mapping addAttributeMappingsFromDictionary:@{
@"label": @"label",
@"icon": @"iconName",
@"action": @"actionName",
@"children": @"children"
}];
return mapping;
}