2011-12-31 46 views

回答

4

如果實現委託willRedirectToUrl,委託獲得的對重定向會發生什麼的完全控制,因此需要採取必要的行動 - 從.H:

// Called on the delegate (if implemented) when the request receives a Location header and shouldRedirect is YES 
// The delegate can then change the url if needed, and can restart the request by calling [request redirectToURL:], or simply cancel it 

所以你只需要電話:

// Can be called by delegates from inside their willRedirectSelector implementations to restart the request with a new url 
- (void)redirectToURL:(NSURL *)newURL; 

傳遞newURL。

+0

乾杯!它是如此容易! – JonasG 2012-01-01 11:36:19