线程与异步调用 [英] Thread Vs Async call
问题描述
我想了解在生成线程或使用NSURLConnection类进行异步调用之间的最佳方法.
I wanted to know the best between Spawning a Thread or making a async call using NSURLConnection class.
推荐答案
请参见 NSURLConnection对象提供支持执行加载网址请求.的界面NSURLConnection是稀疏的,提供只有控件可以启动和取消URL请求的异步加载.
An NSURLConnection object provides
support to perform the loading of a
URL request. The interface for
NSURLConnection is sparse, providing
only the controls to start and cancel
asynchronous loads of a URL request. 即NSURLConnection only 支持内容的异步加载.甚至 i.e. NSURLConnection only supports asynchronous loading of content. Even the sendSynchronousRequest:returningResponse:error: method is really just a wrapper around async loading that blocks until done. 该类参考链接到编程指南和许多示例. That class reference has links to both the programming guide and numerous examples. 这篇关于线程与异步调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!