[英]How to open links in UIWebView in iphone
I want to open a link in my application and I don't want to close my application aw well.我想在我的应用程序中打开一个链接,我不想很好地关闭我的应用程序。 I have navigation bar on top of application and just below the navigation I want to open my web view.我在应用程序顶部有导航栏,在导航下方我想打开我的 web 视图。 I have defined my outlet.我已经定义了我的出口。
IBOutlet UIWebView *displaySingleData;
How will I open an link in my application.我将如何在我的应用程序中打开链接。
Thanks in advance提前致谢
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];
jst write following code:只需编写以下代码:
[displaySingleData loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]];
Happy coding..快乐的编码..
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.