有什么办法来访问响应数据中签块使用对象管理的要求?
[objectManager postObject:[User class] path:@"/users" parameters:nil success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) {
NSLog(@"success");
} failure:^(RKObjectRequestOperation *operation, NSError *error) {
NSLog(@"failure");
}];
好像应该有某种方式来使用映射或操作以获取这些信息,也许NSData的什么的。
你可以从RKObjectRequestOperation *操作此信息
operation.HTTPRequestOperation.response
operation.HTTPRequestOperation.responseData
operation.HTTPRequestOperation.responseString
试试这个
[objectRequestOperation setCompletionBlockWithSuccess:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) {
// parse the response---
NSDictionary *myDic = [NSJSONSerialization JSONObjectWithData:operation.HTTPRequestOperation.responseData options:NSJSONReadingMutableLeaves error:nil];
NSLog(@"=======:%@",myDic);
NSLog(@"MY email============ %@ ",[myDic objectForKey:@"Email"]);
} failure:^(RKObjectRequestOperation *operation, NSError *error) {
RKLogError(@"Operation failed with error: %@", error);
}];