Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/97.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 已跳过AFHTTPSessionManager或AFHTTPOperationManager,甚至未执行_Ios_Afnetworking - Fatal编程技术网

Ios 已跳过AFHTTPSessionManager或AFHTTPOperationManager,甚至未执行

Ios 已跳过AFHTTPSessionManager或AFHTTPOperationManager,甚至未执行,ios,afnetworking,Ios,Afnetworking,我是IOS开发新手,正在使用AFNetworing通过第三方api进行与动态数据请求相关的工作,我想这是在IOS中进行联网的好方法 到目前为止,我遇到的一个问题是在两个不同的类实现文件中有两个AFHTTPSessionManager。当我运行应用程序时,第一个应用程序成功执行。但是第二个不工作,问题是在调试模式下,我可以看到 AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; [manager GET:PLACE_DET

我是IOS开发新手,正在使用
AFNetworing
通过第三方api进行与动态数据请求相关的工作,我想这是在IOS中进行联网的好方法

到目前为止,我遇到的一个问题是在两个不同的类实现文件中有两个
AFHTTPSessionManager
。当我运行应用程序时,第一个应用程序成功执行。但是第二个不工作,问题是在调试模式下,我可以看到

AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
[manager GET:PLACE_DETAIL_URL
  parameters:@{ @"key": APPLICATION_KEY,
                @"placeid": placeid,
                @"extensions": @"review_summary"
                }
     success:^(NSURLSessionDataTask *task, id responseObject) {
         NSLog(@"%@", responseObject);
         placeDetail = [[NSDictionary alloc] initWithDictionary: (NSDictionary *) [responseObject objectForKey:@"result"]];
     } failure:^(NSURLSessionDataTask *task, NSError *error) {
         UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error Places"
                                                             message:[error localizedDescription]
                                                            delegate:nil
                                                   cancelButtonTitle:@"Ok"
                                                   otherButtonTitles:nil];
         [alertView show];
     }];
甚至没有执行。由于某种原因,它被跳过了。这是一个bug还是我一次只能在
AFHTTPSessionManager
AFHTTPOperationManager
上运行

附言。 调试gif张贴在这里的明确的想法。


谢谢你的帮助。

什么部分没有执行?我编辑了代码,看起来更好了。整个
[manager GET]
部分。没有失败,也没有成功。是否检查添加基本URL是否有帮助?那没用。问题是,我有第一个使用相同的代码但在不同的类文件中工作<代码>成功和
失败
块没有执行…并且您可以确定这段代码确实得到了执行。您是否在该方法中设置了断点?