HomeiOS Developmentbasis - What is the distinction between NSLocale currentLocale vs autoupdatingCurrentLocale?

basis – What is the distinction between NSLocale currentLocale vs autoupdatingCurrentLocale?


The currentLocale solely retrieve an locale object one time from the present consumer’s settings. autoupdatingCurrentLocale updates the locale object on the fly so that you needn’t validate. You may assume autoupdateingCurrentLocale is the choose approach, it’s per Apple documentation; nonetheless, because the returned object could also be cached, you do not really want to carry on to it indefinitely when utilizing currentLocale, verse autoupdateingCurrentLocale.
If you’re utilizing autoupdatingCurrentLocale, word that this API don’t cache the locale object, so you’ll need a strategy to compute cache upon receipt. A technique is to make use of notification comparable to NSCurrentLocaleDidChangeNotification technique name.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments