iphone - 线程与异步调用

标签 iphone cocoa-touch ios nsurlconnection nsthread

我想知道生成线程或使用 NSURLConnection 类进行异步调用之间的最佳选择。

最佳答案

参见 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.

即NSURLConnection 支持内容的异步加载。甚至是sendSynchronousRequest:returningResponse:error:方法实际上只是异步加载的包装,在完成之前会阻塞。

该类引用包含编程指南和大量示例的链接。

关于iphone - 线程与异步调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5445605/

相关文章:

ios - 如何在上传到用户 Dropbox 之前加密 .plist?

ios - 在 1 到 100 的范围内将 UISlider 递增 1

ios - Appcode找不到目的地

iphone - NSDictionary 中的键和值是有序的吗?

ios - 复制 UITableViewCell

ios - UIKeyboard 弹出时 UIWindow 子类不旋转

ios - 保存游戏中心数据(GKTurnBasedMatch)的良好做法?

java - 使用 Java SSL 套接字的 Apple 推送通知

iphone - 编译 iPhone XCode 项目以在 Android 上运行

iphone - "Root element is missing"iOS 中的 Soap 请求