开发者

Going to a UIWebView from an IBAction

开发者 https://www.devze.com 2023-02-15 17:39 出处:网络
I would like to know how do I load a web view from an开发者_如何学C \"- (IBAction) buttonPressed\" function. IBOutlet UIWebView *webView;

I would like to know how do I load a web view from an开发者_如何学C "- (IBAction) buttonPressed" function.


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];


    }


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

0

精彩评论

暂无评论...
验证码 换一张
取 消