Objective c NSURLConnection在backgorund中发出同步请求
像标题一样,我的问题是,是否有可能在后台发出同步请求。 我的实际代码是:Objective c NSURLConnection在backgorund中发出同步请求,objective-c,Objective C,像标题一样,我的问题是,是否有可能在后台发出同步请求。 我的实际代码是: NSData *dataReply = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error]; 不仅可能,实际上这是推荐的方法,最好是在自己的线程上调用它。另一方面,异步调用更好 查看NSThread detachNewThreadSelector:toTarget:wit
NSData *dataReply = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error];
不仅可能,实际上这是推荐的方法,最好是在自己的线程上调用它。另一方面,异步调用更好 查看NSThread detachNewThreadSelector:toTarget:withObject。