iOS5 NSURLConnection methods deprecated

后端 未结 4 1905
悲&欢浪女
悲&欢浪女 2020-12-04 18:48

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 fr

4条回答
  •  盖世英雄少女心
    2020-12-04 19:15

    The documentation is a @$@#$ mess. That's the real story.

    The Documentation on NSURLConnection, as written, leaves you high and dry.

    The first part of the documentation tells you to use various methods in the NSURLConnection protocol (like connection:didReceiveData:) to handle incoming data. If you click on any of those methods in the overview, it leads you to a list of DEPRECATED METHODS!)

    The real story that I've been able to piece together is that most of the methods formerly in NSURLConnectionProtocol have been moved to a new protocol called NSURLConnectionDataProtocol. Unfortunately, that new protocol is either not documented, or it's not indexed, so you can't find it. Which amounts to the same thing.)

    In other interesting news, there is apparently a new protocol called NSURLConnectionDownloadDelegate. It sounds like NSURLConnection for iOS is adding some of the functionality that is available in NSURLDownload in MacOS. The NSURLConnectionDownloadDelegate protocol IS documented.

提交回复
热议问题