草庐IT

iphone - NSURLConnection didFailWithError connectionDidFinishLoading 同时调用?

coder 2023-10-01 原文

关于“didFailWithError”和“connectionDidFinishLoading

他们都可以叫吗?或者它总是一个或另一个?

最佳答案

不可以,不能同时调用。

委托(delegate)收到消息 connection:didFailWithError: 后,它不再收到指定连接的委托(delegate)消息。

如果连接成功下载请求,则代理会收到 connectionDidFinishLoading: 消息。委托(delegate)将不会再收到有关连接的消息,并且可以释放 NSURLConnection 对象。

http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html

关于iphone - NSURLConnection didFailWithError connectionDidFinishLoading 同时调用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12886749/

有关iphone - NSURLConnection didFailWithError connectionDidFinishLoading 同时调用?的更多相关文章

随机推荐