0

我想知道如何从“ - (IBAction) buttonPressed”函数加载 Web 视图。

4

2 回答 2

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


    }
于 2011-03-07T04:29:18.830 回答
0

使 -(IBAction) 加载一个新视图,并将 UIWebView 放在该新视图中。

于 2011-03-07T04:01:17.450 回答