0

the Question :

how to invoke the UIWebview's delegate method

- (BOOL)webView:(UIWebView *)webView 
        shouldStartLoadWithRequest:(NSURLRequest *)request 
        navigationType:(UIWebViewNavigationType)navigationType

Please show me all of the trigger

Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
user5465320
  • 719
  • 2
  • 7
  • 15

3 Answers3

2

If you have set your UIWebView to an IBOutlet, you can do this in your viewDidLoad: method:

myWebView.delegate = self

Then, whenever anything happens in the web view, your delegate method in your view controller will be called.

Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
0

First Step

@interface ViewController ()<UIWebViewDelegate>

@end

then set Delegate of your UIWebview to self

self..webview.delegate = self

then implement method you need

Prashant Tukadiya
  • 15,838
  • 4
  • 62
  • 98
0

You can create and IBOutlet for webview and can set it's delegate like self.webview.delegate=self or you can set the delegate from Interface Builder by clicking and dragging from UIWebview to the Yellow icon on your view controller.

Karl Gjertsen
  • 4,690
  • 8
  • 41
  • 64