我沒有看到這兩個方法調用的時候,我開始我的NSURLConnection
:NSURLConnection的委託方法調用僅在viewDidLoad中
-(BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace;
-(void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;
這工作時,我在viewDidLoad
創建NSURLConnection
但是當我打電話從另一個函數,我沒有看到canAuthenticateAgainstProtectionSpace
叫。這是我如何創建我的NSURLConnection
:
[UIApplication sharedApplication].networkActivityIndicatorVisible=YES;
NSURLRequest *request = [NSURLRequest requestWithURL: [NSURL URLWithString:video_link1]];
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
[connection start];
是的,你是對的羅布 – ThananutK