这是我的代码:
[[AFNetworkReachabilityManager sharedManager] startMonitoring];
mainManager = [AFHTTPRequestOperationManager manager];
mainManager.requestSerializer.timeoutInterval = 30;
我像这样初始化我的 AFHTTPRequestOperationManager 。
urlToWhere = @"myurl.php";
parameters = @{@"user_id": "1"};
NSLog(@"a");
[mainManager POST:urlToWhere parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"result");
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"error");
}];
NSLog(@"b");
事实是我的 a 显示在日志中,但没有显示“结果”或“错误”,然后显示 b。
AFHTTPRequestOperationManager 是否有任何例外情况?