iphone - iPhone 操作系统上的 NSCurrentLocaleDidChangeNotification

标签 iphone cocoa-touch

虽然 NSCurrentLocaleDidChangeNotification 在 Mac OS X 上完全有意义,但我不知道如何在 iPhone OS 上接收它。为了更改区域设置,您必须退出正在运行的应用程序,然后在设置常规国际区域中进行更改格式。此时,您的应用程序尚未运行,那么它如何收到通知?

我首先以为这个通知是 Mac OS X 文档中遗留下来的,但后来我在 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.

那么,如何在 iPhone 操作系统上触发此通知?

最佳答案

目前,您还不需要,因为在更改区域设置时您无法运行任何应用程序。将来,您可能会(提示提示*)。

请注意,您可以照常通过 +[NSLocale currentLocale] 轮询当前区域设置。

* 我不了解任何内幕信息。

关于iphone - iPhone 操作系统上的 NSCurrentLocaleDidChangeNotification,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2508031/

相关文章:

iphone - 尝试使用快速角检测器成功实验室时,Apple O型匹配链接器错误

ios - 在iOS中添加外部框架时出现的问题

iphone - iOS 5 : Image Filters

iphone - 在 float 和 float 之间获取随机 float 的最佳方法是什么?

iphone - Objective-C 代码中未找到 windowScriptObject 方法

iphone - 应用内购买沙箱测试错误

ios - 前置闪光灯亮度 iPhone

iphone - 在 iOS4 中保存 PDF 文件时出现问题

ios - 如何在锁定屏幕上显示与左下角相机相同的 iphone 应用程序图标

objective-c - 对 UITextField 上的操作进行单元测试