Kir*_*ron 3 iphone ios4 ios ios5 ios6
I have a code where it shows all countries and we can select a specific country from it. What i want now is when i select a country i want to see the list of states in that country. Can any one please help me in that ? Is there a method or API for it? Any help is appreciated. thanks
使用db用于获取countries and its states.只需下载它.
现在使用这个db来查询如下:
NSString *queryString = [NSString stringWithFormat:@"select zone_id , name from
zone where country_id = %d", countryID]; //here countryID is country code
Run Code Online (Sandbox Code Playgroud)
编辑:获取所有国家/地区的查询,如下所示:
NSString *queryStrAllCountries = [NSString stringWithFormat:@"select name from
countries"];
Run Code Online (Sandbox Code Playgroud)
从使用以下查询选择的国家/地区获取countryID:
NSString *queryStrCountry = [NSString stringWithFormat:@"select country_id from
countries where name='%@'", countryName]; //provide country name selected
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1102 次 |
| 最近记录: |