i would like to know how to call an objective c method from javascript. for example i have a javascript function defined in my myFile.js like this :
function() {
alert('test');
.... // How i can an objective c function here ???
}
i have also a UIWebView :
-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
....
// what to do here ??????
}
thanks for your answer
Just set the location to something you recognize and check if the request.URL matches that.
Note: I haven’t tested this but I imagine it will work, though the URL returned by request.URL.relativeString may be a bit different, so just set a breakpoint there and see what it is.