I am using uiwebview to display webpages on ipad . I use this code :-
[[self request] setDelegate:nil];
[[self request] cancel];
[self setRequest:[ASIWebPageRequest requestWithURL:navigationURL]];
[[self request] setDelegate:self];
[[self request] setDidFailSelector:@selector(webPageFetchFailed:)];
[[self request] setDidFinishSelector:@selector(webPageFetchSucceeded:)];
[[self request] setShouldPresentProxyAuthenticationDialog:YES];
[[self request] setShouldPresentCredentialsBeforeChallenge:YES];
[[self request] setShouldPresentAuthenticationDialog:YES];
// Tell the request to embed external resources directly in the page
[[self request] setUrlReplacementMode:ASIReplaceExternalResourcesWithData];
// It is strongly recommended you use a download cache with ASIWebPageRequest
// When using a cache, external resources are automatically stored in the cache
// and can be pulled from the cache on subsequent page loads
[[self request] setDownloadCache:[ASIDownloadCache sharedCache]];
// Ask the download cache for a place to store the cached data
// This is the most efficient way for an ASIWebPageRequest to store a web page
[[self request] setDownloadDestinationPath:
[[ASIDownloadCache sharedCache] pathToStoreCachedResponseDataForRequest:[self request]]];
[[self request] startAsynchronous];
Navigation url gets values from one screen where user inputs URL .
and after this
- (void)webPageFetchSucceeded:(ASIHTTPRequest *)theRequest
{ NSString *response = [NSString stringWithContentsOfFile:
[theRequest downloadDestinationPath] encoding:[theRequest responseEncoding] error:nil];
// Note we're setting the baseURL to the url of the page we downloaded.
//This is important!
[web loadHTMLString:response baseURL:navigationURL];
//[web loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[theRequest downloadDestinationPath]]]];
}
This works fine but there is only one issue i am facing currently .When i try to open one of the links which has images and some animations , animations work fine but no images are displayed in webview.i just see a rect box allocated for image .Same link works perfectly fine on safari browser with all animations and images . How to overcome this issue.