草庐IT

NSLocaleIdentifier

全部标签

ios - xcode 6.1 iOS 8.1 NSLocale displayNameForKey NSLocaleIdentifier 返回 nil

-(NSString*)countryNameByCode:(NSString*)countryCode{NSString*identifier=[NSLocalelocaleIdentifierFromComponents:@{NSLocaleCountryCode:countryCode}];NSString*countryName=[[NSLocalecurrentLocale]displayNameForKey:NSLocaleIdentifiervalue:identifier];returncountryName;}这返回了nil。为什么? 最佳

ios - xcode 6.1 iOS 8.1 NSLocale displayNameForKey NSLocaleIdentifier 返回 nil

-(NSString*)countryNameByCode:(NSString*)countryCode{NSString*identifier=[NSLocalelocaleIdentifierFromComponents:@{NSLocaleCountryCode:countryCode}];NSString*countryName=[[NSLocalecurrentLocale]displayNameForKey:NSLocaleIdentifiervalue:identifier];returncountryName;}这返回了nil。为什么? 最佳