Ajay_Kumar
Ajay_Kumar

Reputation: 1387

How to open links in UIWebView in iphone

I want to open a link in my application and I don't want to close my application aw well. I have navigation bar on top of application and just below the navigation I want to open my web view. I have defined my outlet.

 IBOutlet  UIWebView *displaySingleData;

How will I open an link in my application.

Thanks in advance

Upvotes: 1

Views: 1775

Answers (2)

Rakesh Bhatt
Rakesh Bhatt

Reputation: 4606

NSString *urlAddress = @”http://www.google.com”;

//Create a URL object.
NSURL *url = [NSURL URLWithString:urlAddress];

//URL Requst Object
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];

//Load the request in the UIWebView.
[webView loadRequest:requestObj];

Upvotes: 2

Abdurrashid Khatri
Abdurrashid Khatri

Reputation: 338

jst write following code :

[displaySingleData loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]];

Happy coding..

Upvotes: 1

Related Questions