Reputation: 1387
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
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
Reputation: 338
jst write following code :
[displaySingleData loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]];
Happy coding..
Upvotes: 1