I have a problem where I load a URL in UIWebView. The URL redirects to a different location. I handle this redirect with the following code:
- (NSURLRequest *)connection:(NSURLConnection *)inConnection willSendRequest:(NSURLRequest *)inRequest redirectResponse:(NSURLResponse *)inResponse {
if(inResponse) {
NSMutableURLRequest *req = [[inConnection originalRequest] mutableCopy];
[req setURL:[inRequest URL]];
return req;
}
return inRequest;
}
However, when the page loads, I get 404 on all the images. I can load the URL in Safari without any problems. This is happening on iOS6.1 and iOS7
I'm completely stumped as to what to do. Unfortunately, I don't have access to the server, so I have to handle everything in my app.
Thanks for any advice.