2
votes

I am using UIWebView. I have 4 links I know shouldStartLoadWithRequest function gets called when a link is clicked. But I need to differentiate, may be send some argument value when these links are clicked (different values). when i dubug the request holds the url of the page the webview is rendering.

I need to do dofferent things with info when these links are clicked.

thanks

1
i think i did not explain it right. this still gives me the file://test.html link. I need to figure out if the href 1 is clicked or href 2 is clicked. below is my html <html> <head> </head> <body> <a href="link1">Link1</a><a href="link2">Link2</a> </body> </html>sununest
Are you asking the to get the link no. from the webpage loaded?Robin
yes, this html stays in a file called test.html. Your solution gives me file://<appDocument>/test.html what i need to figure out is i need to go to viewcontroller 1 if link 1 is clicked, viewcontroller 2 if link 2 is clicked also need to pass some argumnts to these viewcontrollerssununest
Ok, figured out [[request URL] absoluteString] does the tricksununest

1 Answers

1
votes

You can check the links instead, like this

NSString *URLString = [[webview.request URL] absoluteString];