What is the equivalent of the UIWebView selector webView:shouldStartLoadWithRequest:navigationType: in MonoTouch? From intellisense in MonoDevelop I see that the UIWebView has a property Delegate and also has a property ShouldStartLoad which is of type UIWebLoaderControl. Which of these is the correct way of setting up a delegate for the UIWebView such that the selector webView:shouldStartLoadWithRequest:navigationType: can be defined and called when the UIWebView loads a request.
Equivalent of the UIWebView selector webView:shouldStartLoadWithRequest:navigationType: in MonoTouch
Asked
Active
Viewed 1,161 times
1 Answers
2
I got the answer to this question from an answer to another question posted by miguel.de.icaza.
The way to solve this in MonoTouch is to hook up to the ShouldStartLoad property like this:
myView.ShouldStartLoad = (webView, request, navType) => {
// Determine here what to do
}
Thanks, Miguel.
I am not sure why setting the Delegate property of the UIWebView to a UIWebViewDelegate object with a ShouldStartLoad overridden method did not work. Maybe someone could shed some light on this.
-
Also curious about this second part, set an instance of my custom webviewdelegate to the instance of my webview.delegate and none of the overridden members ever hit. – Chuck Pinkert Oct 19 '11 at 21:19