I know that there is another similar question , but it is for an older version of AFNetworking and does not actually answer it.
I have the following code:
AFHTTPRequestOperationManager* manager = [AFHTTPRequestOperationManager manager]; manager.securityPolicy.allowInvalidCertificates = YES; manager.requestSerializer = [AFJSONRequestSerializer serializer]; [manager.requestSerializer setAuthorizationHeaderFieldWithUsername: currentUser() password: currentPassword()]; __block NSDictionary* response = nil; AFHTTPRequestOperation* operation = [manager GET: @"https://10.20.30.40:8765/foobar" parameters: [NSDictionary dictionary] success:^(AFHTTPRequestOperation* operation, id responseObject){ response = responseObject; NSLog(@"response (block): %@", response); } failure:^(AFHTTPRequestOperation* operation, NSError* error){ NSLog(@"Error: %@", error);} ]; [operation waitUntilFinished]; NSLog(@"response: %@", response); ...
If I ran this, then I will see in my journal:
2013-12-09 09:26:20.105 myValve[409:60b] response: (null) 2013-12-09 09:26:20.202 myValve[409:60b] response (block): { F00005 = ""; F00008 = ""; F00013 = ""; }
NSLog , after the first start of waitUntilFinished . I expected him to fire a second. What am I missing?
ios objective-c afnetworking-2
Travis griggs
source share