I'm learning to use AFNetworking
and do a GET request.
AFNetworking (3.1.0)
XCode 6
Code:
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
[manager GET:@"http://localhost:5000/index" parameters:nil progress:nil success:^(NSURLSessionTask *task, id responseObject) {
NSLog(@"JSON: %@", responseObject);
} failure:^(NSURLSessionTask *operation, NSError *error) {
NSLog(@"Error: %@", error)p;
}];
However, I got the error
Incompatible block pointer types sending 'void (^)(NSURLSessionTask *__strong, NSError *__strong)' to parameter of type 'void (^ __nullable)(NSURLSessionDataTask * __nonnull __strong)'
Tried many times but couldn't figure out why?
Xcode 6
supportAFNetworking 3.0+
? – jinglei