NSURLConnection didReceiveData not called

前端 未结 4 1841
自闭症患者
自闭症患者 2020-12-10 17:38

I\'ve read through tons of messages saying the same thing all over again : when you use a NSURLConnection, delegate methods are not called. I understand that Apple\

4条回答
  •  春和景丽
    2020-12-10 18:00

    I ran into the same problem. Very annoying, but it seems that if you implement this method:

    - (void)connectionDidFinishDownloading:(NSURLConnection *)connection destinationURL:(NSURL *)destinationURL
    

    Then connection:didReceiveData: will never be called. You have to use connectionDidFinishLoading: instead... Yes, the docs say it is deprecated, but I think thats only because this method moved from NSURLConnectionDelegate into NSURLConnectionDataDelegate.

提交回复
热议问题