0
我想我在iOS捷克聯繫人中發現了一個錯誤。我創建了一個捷克聯繫人(與捷克共和國國家),我在我的應用程序中使用ABPeoplePickerNavigationController選擇了該聯繫人。IOS:錯捷克國家代碼
地址的日誌的ABPeoplePickerNavigationController返回我的是:
"Country" : "Czech Republic"
"Street" : "A street"
"CountryCode" : "cs"
"City" : "A city"
"ZIP" : "12345"
所以國家代碼是CS。但是,當我嘗試中檢索相應的名稱,
NSString *countryCode = [address objectForKey:(NSString *)kABPersonAddressCountryCodeKey];
if (countryCode != nil) {
NSString *countryName = [[NSLocale currentLocale] displayNameForKey:NSLocaleCountryCode value:countryCode];
name = [[applicationDelegate dataManager] objectForEntityForName:@"Name" withValue:countryName forKey:@"name"];
}
name
給我:「塞爾維亞和黑山」!
據http://countrycode.org/,捷克國家代碼是CK,並根據http://xml.coverpages.org/country3166.html,CS是捷克斯洛伐克,但「不復存在」
我怎麼會知道這個蘋果?
你用CZ試過嗎? – self
我沒有進入CS既不是CZ,我剛剛創建了我的聯繫人,選擇了「捷克共和國」作爲國家,保存並從ABPeoplePickerNavController訪問他。但我沒有嘗試手動設置CZ。我很確定它會工作... – Martin