willSendRequest redirectResponse doesn't work in iPhone SDK2.0

Posted by WholeIphone on Stack Overflow See other posts from Stack Overflow or by WholeIphone
Published on 2010-04-08T01:49:51Z Indexed on 2010/04/08 1:53 UTC
Read the original article Hit count: 321

Filed under:
|

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?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about redirect