我有一个来自 xml 的 NSString urlone 中的 url。但我运行应用程序它给出了过多的错误错误
// urlone contains http://www.forasinvest.com/v2/index.php
NSString*myurl=urlone;
NSURL *url = [NSURL URLWithString:myurl];
[[UIApplication sharedApplication] openURL:url];
最佳答案
我认为它应该可以正常工作,好的,只需复制粘贴以下内容进行简单测试
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"http://www.forasinvest.com/v2/index.php"]];
关于iphone - 如何在iPhone中单击按钮时打开网址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8738373/