¡@

Home 

2014/10/15 ¤U¤È 10:12:51

iphone Programming Glossary: preferredlanguages

always returns “en_US” not user's current language

http://stackoverflow.com/questions/1522210/always-returns-en-us-not-users-current-language

0 NSLog @ preferredLang @ preferredLang Peter's answer seems to be a better solution NSArray preferredLangs NSLocale preferredLanguages NSLog @ preferredLangs @ preferredLangs iphone objective c cocoa internationalization share improve this question Instead..

iPhone Memory Management

http://stackoverflow.com/questions/2078016/iphone-memory-management

from viewDidLoad is below Set the background image based on the phone's preferred language NSString language NSLocale preferredLanguages objectAtIndex 0 NSString backgroundImageName NSString alloc init backgroundImageName NSString stringWithFormat @ background.. cause the app to crash Thanks iphone memory management share improve this question NSString language NSLocale preferredLanguages objectAtIndex 0 Here language does not need to be released because objectAtIndex autoreleases it for you. By convention..

iPhone App Localization - English problems?

http://stackoverflow.com/questions/3308519/iphone-app-localization-english-problems

argv NSAutoreleasePool pool NSAutoreleasePool alloc init Set up the locale jiggery pokery NSString language NSLocale preferredLanguages objectAtIndex 0 NSString locale NSLocale currentLocale objectForKey NSLocaleCountryCode if language isEqualToString @ en..

Getting current device language in iOS?

http://stackoverflow.com/questions/3910244/getting-current-device-language-in-ios

be English United States . In order to retrieve the currently selected language you can do NSString language NSLocale preferredLanguages objectAtIndex 0 This will return a two letter code for the currently selected language. en for English es for Spanish de.. between region and currently selected language. EDIT Worth to quote the header information from NSLocale.h NSArray preferredLanguages NS_AVAILABLE 10_5 2_0 note that this list does not indicate what language the app is actually running in the NSBundle mainBundle..

NSDateFormatter and Japanese calendar

http://stackoverflow.com/questions/4677006/nsdateformatter-and-japanese-calendar

using the following line of code. dateFormat setLocale NSLocale alloc initWithLocaleIdentifier NSLocale preferredLanguages objectAtIndex 0 autorelease This will provide the correct user locale to the NSDateFormatter. Some people might be tempted..