簡體   English   中英

NSNotificationCenter是否可能在某些設備上不起作用?

[英]Is it possible that NSNotificationCenter doesn't work on certain devices?

我在iPhone App中使用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。 是否還有其他需要的設置或任何明確的用戶設置,或者可以打開/關閉此設置?

不,通知中心可靠。

“不工作”信息不足以診斷問題。 從用戶那里獲取更多信息或添加更多日志記錄,以便您了解實際情況。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM