I use AFNetworking to write a RESTful client. An then use JSONKit to parse the response data to a NSDictionary.
Example:
- (void)postPath:(NSString *)path
parameters:(NSDictionary *)parameters
success:(void (^)(AFHTTPRequestOperation *operation, id responseObject, NSDictionary* jsonDictionary))success
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure
{
[self.client postPath:path parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSDictionary* jsonDictionary = [self.jsonDecoder objectWithData:responseObject];
// do the object-mapping works
success(operation, responseObject, jsonDictionary);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
failure(failure, error);
}];
}
How can I use the benefit of RKObjectMapping from RESTKit as a standalone library to do the object-mapping? Thanks in advance.