NSURLConnection一团糟

时间:2012-01-13 09:37:18

标签: ios nsurlconnection

我需要为NSURLConnection提供一个代理作为帮助状态:

+ (NSURLConnection *)connectionWithRequest:(NSURLRequest *)request delegate:(id < NSURLConnectionDelegate >)delegate

看过NSURLConnectionDelegate的帮助后,我发现它包含以下方法:

– connection:willSendRequestForAuthenticationChallenge:
– connection:canAuthenticateAgainstProtectionSpace:
– connection:didCancelAuthenticationChallenge:
– connection:didReceiveAuthenticationChallenge:
– connectionShouldUseCredentialStorage:
– connection:didFailWithError:

大。但是“使用NSURLConnection”用户指南说明: 为了下载URL的内容,应用程序需要提供一个委托对象,该对象至少实现以下委托方法:connection:didReceiveResponse:,connection:didReceiveData:,connection:didFailWithError:和connectionDidFinishLoading:。

这些方法几乎与NSURLConnectionDelegate帮助中提到的方法没有任何共同之处。有人能解释一下吗?

0 个答案:

没有答案