2013-10-29 31 views
1

我想从ios中的浏览器打开URL。我知道如何打开一个正常的URL ..但在这里我想通过一个参数的URL ....这是我用来从浏览器如何使用ios中的参数在浏览器中打开url

NSURL *url = [NSURL URLWithString:@"http://www.iphonedevelopertips.com"]; [[UIApplication sharedApplication] openURL:url];

打开网址,然后我怎么能根据通过参数修改这个

谢谢

回答

0

这里我通过国名。你可以通过任何你想要的东西。

[email protected]"India"; 

NSURL * url=[NSURL URLWithString:[NSString stringWithFormat:@"http://www.webservicex.net/globalweather.asmx/GetCitiesByCountry?CountryName=%@",CountryName]]; 

确实喜欢这个通过任何你想要通过这样的。

+1

这不起作用。你需要使用'stringWithFormat'来构建字符串。 – rmaddy

+0

@rmaddy感谢我的愚蠢的错误检查出我更新的答案... – Jitendra

相关问题