久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

不推薦使用 iOS5 NSURLConnection 方法

iOS5 NSURLConnection methods deprecated(不推薦使用 iOS5 NSURLConnection 方法)
本文介紹了不推薦使用 iOS5 NSURLConnection 方法的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

限時(shí)送ChatGPT賬號(hào)..

我正在嘗試編寫一個(gè) iOS 應(yīng)用程序,它發(fā)出異步請(qǐng)求以通過網(wǎng)絡(luò)獲取數(shù)據(jù).似乎很多人為此推薦使用 NSURLConnection,并且經(jīng)常提到委托方法 connection:didReceiveData:.

I'm trying to write an iOS app that makes asynchronous requests to get data over the network. It seems like a lot of people recommend using NSURLConnection for this, and frequently mention the delegate method connection:didReceiveData:.

不幸的是,我終生無法找到此委托方法的文檔記錄.一方面,它不在 NSURLConnectionDelegate 的協(xié)議參考.它列在 NSURLConnection 類參考,但顯然在 iOS5 中已被棄用.該文檔沒有解釋為什么它被棄用,或者開發(fā)人員應(yīng)該使用什么來實(shí)現(xiàn)類似的功能.

Unfortunately, I cannot for the life of me find out where this delegate method is documented. For one, it is not in the protocol reference for NSURLConnectionDelegate. It is listed in the NSURLConnection Class Reference, but has apparently been deprecated as of iOS5. The documentation does not explain why it was deprecated, or what developers should use instead to achieve similar functionality.

我錯(cuò)過了什么?我讀過的很多內(nèi)容似乎暗示了對(duì) iOS5 的 NSURLConnection 進(jìn)行了重大更改.這些更改記錄在哪里?委托方法的文檔是否完整?

What am I missing? A lot of what I've read seems to imply that big changes were made to NSURLConnection for iOS5. Where are these changes documented? Is the documentation of delegate methods complete?

謝謝

推薦答案

搜索頭文件告訴我,這些方法已從非正式協(xié)議(這是一種已棄用的 Obj-C 模式)轉(zhuǎn)移到名為 NSURLConnectionDataDelegate 位于 NSURLConnection.h 中,但沒有公共文檔.

Fishing around the header files tells me that the methods were moved from an informal protocol (which is a deprecated Obj-C pattern) into a formal delegate protocol called NSURLConnectionDataDelegate that's in NSURLConnection.h, but doesn't have a public documentation.

文檔的其余部分繼續(xù)使用以前的方法,所以我猜這是文檔中的一個(gè)遺漏.IE.這些方法(大部分)不會(huì)去任何地方,它們只是被改組為幾個(gè)協(xié)議,文檔團(tuán)隊(duì)一直在懈怠.嘗試使您的委托對(duì)象符合適當(dāng)?shù)膮f(xié)議,并使用頭文件中的簽名實(shí)現(xiàn)方法.

The rest of the documentation keeps using the methods as before, so my guess is this is an omission in the documentation. I.e. the methods (mostly) aren't going anywhere, they were just reshuffled into several protocols and the documentation team has been slacking off. Try making your delegate object conform to the appropriate protocol, and implement the methods with the signatures from the header file.

這篇關(guān)于不推薦使用 iOS5 NSURLConnection 方法的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Change Line Color of EditText - Android(更改 EditText 的線條顏色 - Android)
Changing where cursor starts in an expanded EditText(更改光標(biāo)在展開的 EditText 中的開始位置)
Send backspace key event to edit text(發(fā)送退格鍵事件以編輯文本)
Android: How to set password property in an edit text?(Android:如何在編輯文本中設(shè)置密碼屬性?)
Label in a editbox in android(在android的編輯框中添加標(biāo)簽)
actionDone imeOption doesn#39;t work on EditText in Android 2.3(actionDone imeOption 不適用于 Android 2.3 中的 EditText)
主站蜘蛛池模板: 中文字幕播放 | 四虎在线视频 | 久久久一级片 | 国产欧美日韩视频 | 中文字幕视频一区 | 中文字幕偷拍 | 老司机精品在线 | 国产成人精品一区二区三区在线 | 一级片免费观看 | 欧美三级 欧美一级 | 在线观看欧美日韩 | 国产a一级 | 国产一区在线看 | av少妇| 欧美久久网 | 国产成人免费 | 91av视频在线 | 大乳女喂男人吃奶 | 成人免费看片在线观看 | aaa级片| 99久久精品国产毛片 | 国产无限资源 | 国产91热爆ts人妖系列 | 亚洲综合视频在线 | 伊人网在线视频 | 一区二区三区影院 | 蜜桃色999| 色天堂影院| 成人亚洲精品 | 日本精品视频 | 午夜久久| 午夜福利毛片 | 成人高潮片免费网站 | 免费观看一区二区 | 亚洲视频免费在线观看 | 欧美精品网站 | 九九精品网 | 成人欧美一区二区三区黑人孕妇 | 久久99精品久久久久久 | 91精品国自产在线观看 | 国产三级黄色 |