morgy
morgy

Reputation: 1

Going to a UIWebView from an IBAction

I would like to know how do I load a web view from an "- (IBAction) buttonPressed" function.

Upvotes: 0

Views: 623

Answers (2)

Gypsa
Gypsa

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

brian jones
brian jones

Reputation: 1

Make the -(IBAction) load a new view, and put a UIWebView in that new view.

Upvotes: 0

Related Questions