I added directories AFNetworking
and UIKit+AFNetworking
to project manager.
I use latest library 3.0.4
After I imported file AFNetworking.h
in my class file .m
.
I found a lot examples how to make request to url, but information is old.
How to make GET request to URL and get data from server?
Now function AFHTTPRequestOperation
was removed.
This is first time working with libraries in xcode, I am beginner.
For AFNetworking 3.x:
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
[manager GET:@"http://example.com/resources.json" parameters:nil progress:nil success:^(NSURLSessionTask *task, id responseObject) {
NSLog(@"JSON: %@", responseObject);
} failure:^(NSURLSessionTask *operation, NSError *error) {
NSLog(@"Error: %@", error);
}];