A
A
Avtolubitel2015-03-24 15:54:04
iOS
Avtolubitel, 2015-03-24 15:54:04

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

1 answer(s)
A
Alexander Shcherbakov, 2015-04-02
@mkll

Something like
id newObject = [responseObject copy];
where newObject is a global variable / property.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question