私は、HTTP 基本認証を使用する Web サービスを使用していますNSURLConnection。私のでは、 、
、および
NSURLConnectionDelegateを実装しましたが、どれも呼び出されません。–[NSURLConnectionDelegate connection:canAuthenticateAgainstProtectionSpace:]–[NSURLConnectionDelegate connection:didCancelAuthenticationChallenge:]–[NSURLConnectionDelegate connection:didReceiveAuthenticationChallenge:]
と の両方を–[NSURLConnectionDelegate connectionShouldUseCredentialStorage:]返すように実装しようとしましたが、効果はありませんでした。YESNO
また、 myNSURLCredentialStorageが空であることも確認しました。
最後に、–[NSURLConnectionDelegate connection:canAuthenticateAgainstProtectionSpace:]、
–[NSURLConnectionDelegate connection:didCancelAuthenticationChallenge:]、および
–[NSURLConnectionDelegate connection:didReceiveAuthenticationChallenge:]を実装する代わりに を実装–[NSURLConnectionDelegate connection:willSendRequestForAuthenticationChallenge:]しましたが、どちらも呼び出されませんでした。
NSURLConnectioncallNSURLConnectionDelegateの認証コールバックを行うにはどうすればよいですか?