Reputation: 11
I have a Subview that load a Webview. In this Webview I load a file HTML locally in the Documents folder of my App. I need to check if the webview load another HTML file. Specifically:
location.href= "index2.html"
,How can I do this?
Upvotes: 1
Views: 2174
Reputation: 41
Use this NSURL
method [NSURL fileURLWithPath:@"some/path/to/your/file" isDirectory:NO]
and pass that to a NSURLRequest
which is then passed to your UIWebView
. You can get the path to your resource by using the [[NSBundle mainBundle] pathForResource...]
methods.
Upvotes: 1