This Time i want to know how to determine which button is click in UIWebView.....
appDelegate.mystring = [[NSMutableString string]init];
NSString *b
The only method I know is by implementing webView:shouldStartLoadWithRequest:navigationType
method of UIWebViewDelegate
protocol. The required steps are as follows:
1) Create a new class subclassed from NSObject named, say, MyWebViewDelegate. You can implement only that method:
-(BOOL)webView:(UIWebView*)webView
sholdStartLoadWithRequest:(NSURLRequest *)request
navigationType:(UIWebViewNavigationType)navigationType
{
NSLog(@"%@", [[request URL] relativePath]);
}
2) Create instance of delegate in your code and set it as a delegate of UIWebView before loading page:
MyWebViewDelegate *mydelegate = [[MyWebViewDelegate alloc] init];
mywebview.delegate = mydelegate;
3) And then try to debug. Try to put breakpoint inside ..sholdStartLoadWithRequest:.. method and ensure that you application stops in that breakpoint. Maybe you shold do a little redesign of you HTML webpage to achieve this. After that try to distinguish different buttons by value of request
parameter.