Thread Vs Async call

半世苍凉 提交于 2019-12-11 15:25:30

问题


I wanted to know the best between Spawning a Thread or making a async call using NSURLConnection class.


回答1:


See the documentation.

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.

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.



来源:https://stackoverflow.com/questions/5445605/thread-vs-async-call

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!