Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.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 后台刷新中API调用出错_Ios_Objective C_Asynchronous_Nsurlconnection - Fatal编程技术网

Ios 后台刷新中API调用出错

Ios 后台刷新中API调用出错,ios,objective-c,asynchronous,nsurlconnection,Ios,Objective C,Asynchronous,Nsurlconnection,我正在使用 [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse * _Nullable response, NSData * _Nullable data, NSError * _Nullable connectionError) { }. 请求每20秒调用一次,我收到错误500。请有人帮我解决这个问题。首

我正在使用

 [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse * _Nullable response, NSData * _Nullable data, NSError * _Nullable connectionError) 
{

}.

请求每20秒调用一次,我收到
错误
500。请有人帮我解决这个问题。

首先,确保正确设置了传输安全设置(请参阅)。在此之后,错误500是一个内部服务器错误,因此问题是服务器端,可能是与发送到服务器的参数丢失或错误有关的错误,也可能是服务器上的stg else。是的,问题在于构造请求的方式。在我们以任何有意义的方式提供帮助之前,您必须发布更多的代码。另外,为什么不使用NSURLSession?您仍然支持10.8/iOS 6吗?