Answer the question
In order to leave comments, you need to log in
How to store responseObject in AFNetworking get request?
Killed several hours to save responseObject. I can't figure out how to save it so that I can later use it in another part of the code.
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
[manager GET:@" example.com/resources.json " parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"JSON: %@", responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error: %@", error);
}];
Answer the question
In order to leave comments, you need to log in
Something like
id newObject = [responseObject copy];
where newObject is a global variable / property.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question