Ios NSNotificationCenter是否可能不';不能在某些设备上工作?

Ios NSNotificationCenter是否可能不';不能在某些设备上工作?,ios,iphone,nsnotificationcenter,Ios,Iphone,Nsnotificationcenter,我在iPhone应用程序中使用NSNotificationCenter发布通知 // I add an observer in didFinishLanchingWithOptions() in the AppDelegate [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getData:) name:kNotif_GetData object:nil]; .... ....

我在iPhone应用程序中使用NSNotificationCenter发布通知

 // I add an observer in didFinishLanchingWithOptions() in the AppDelegate
[[NSNotificationCenter defaultCenter] addObserver:self
        selector:@selector(getData:) name:kNotif_GetData object:nil];
....
....
// then in another method, I post the notification
[[NSNotificationCenter defaultCenter] postNotificationName:kNotif_GetData object:nil];
....

一个用户说这个功能(由getData()执行)不起作用。所以这可能意味着通知没有被解雇。知道为什么会这样吗?当我用不同的设备测试它时,它工作得非常完美。用户使用iPhone5和iOS7。是否有任何其他设置或任何明确的用户设置需要或可以打开/关闭此功能?

否,通知中心是可靠的


“不工作”信息不足以诊断问题。从用户处获取更多信息或添加更多日志记录,以便了解实际情况。

可能有各种原因,但“NSNotificationCenter不起作用”的可能性不大。您应该做的一件事是获取故障设备的准确配置—语言设置、区域设置、时区设置,12/24开关设置等。然后在您的设备上复制,尽可能接近。当然,谢谢。我将尝试一下。您可能正在使用NSNotificationCenter进行某些操作,这些操作将在一台设备上运行,而不是在另一台设备上运行。应用程序发布了吗?有些问题只会在版本配置(AppStore,Test Flight)中出现,而在调试模式下本地测试可能会掩盖它。当然,谢谢。我会试试看。