开发者

Going to a UIWebView from an IBAction

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜