Reputation: 1
I would like to know how do I load a web view from an "- (IBAction) buttonPressed
" function.
Upvotes: 0
Views: 623
Reputation: 11314
IBOutlet UIWebView *webView;
-(IBAction)click
{
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: 1
Make the -(IBAction) load a new view, and put a UIWebView in that new view.
Upvotes: 0