NSCurrentLocaleDidChangeNotification on iPhone OS

Posted by 0xced on Stack Overflow See other posts from Stack Overflow or by 0xced
Published on 2010-03-24T13:37:11Z Indexed on 2010/03/24 13:43 UTC
Read the original article Hit count: 176

Filed under:
|

While the NSCurrentLocaleDidChangeNotification perfectly makes sense on Mac OS X, I don't see how you can possibly receive it on iPhone OS. In order to change the locale, you have to quit the running application, then change it in Settings ? General ? International ? Region Format. At that point, your app is not running, so how could it receive the notification?

I first thought this notification was leftover from the Mac OS X documentation, but then I found this in Apple Push Notification Service Programming Guide:

The application might send its provider the preferred language every time the user changes something in the current locale. To do this, you can listen for the notification named NSCurrentLocaleDidChangeNotification and, in your notification-handling method, get the code identifying the preferred language and send that to your provider.

So, how do you trigger this notification on iPhone OS?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about cocoa-touch