且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在webview for iPhone中打开来自字符串的URL

更新时间:2023-11-07 22:18:58

将此添加到您的方法中:

Add this to your method:

    NSString *urlAddress = @"http://myurl.com";

//Create a URL object.
NSURL *url = [NSURL URLWithString:urlAddress];

//URL Requst Object
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];

//Load the request in the UIWebView.
[detailWebView loadRequest:requestObj];