localisation of iphone without changing iphone settings
i had done localisation by changing the language of iPhone through localisableString and by different xib which works only with NSLocale method ,but the r开发者_JS百科equirement of app is to localised it by changing the language in app setting view irrespective of iPhone language..
Sounds like a stupid requirement, but anyway: You can change the language of your app by setting an array with the order of preferred languages for the user defaults key @"AppleLanguages", e.g.:
//Set language to German:
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:[NSArray arrayWithObject:@"de"]
forKey:@"AppleLanguages"];
Note however that this only affects strings/nibs you load afterwards, so you might need to reload your UI after changing the setting.
精彩评论