willSendRequest redirectResponse doesn't work in iPhone SDK2.0
- by WholeIphone
I use the delegate method connection:willSendRequest:redirectResponse: in SDK 2.2, the code like below:
- (NSURLRequest *)connection:(NSURLConnection *)con willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse
{
if(redirectResponse) {
if(!self.autoRedirect) {
NSLog(@"response will redirect");
request = nil;
}
}
return request;
if the request is returned to nil ,it seems it hangs up here, and delegate didReceiveData will not get called.
but it works in SDK 3.
Any suggestions about this?