1

我想在 ios 中从浏览器打开一个 URL。我知道如何打开一个普通的 url.. 但在这里我想将一个参数传递给 url.... 这是我用来从浏览器打开 url

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

那么我该如何根据传递参数来修改它

谢谢

4

1 回答 1

0

在这里,我通过国家名称。你可以传递任何你想要的东西。

CountryName=@"India";   

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

像这样通过任何你想要通过的方式。

于 2013-10-29T04:34:41.770 回答