我有興趣瞭解是否可以在發佈對象的方法完成並刪除之前將觀察對象的方法推入堆棧。NSNotificationCenter:對象是否在他們發佈的同一個線程上接收通知?
18
A
回答
36
簡短答案是肯定的......「定期通知中心在通知發佈線程上發送通知,分佈式通知中心在主線程上發送通知」。
然而,蘋果公司文檔在這個主題,你可能會發現有用的,並且從上述報價被拉:
Notification Programming Topics: Delivering Notifications to Particular Threads
13
只是不屑於看它自己,可恥的:
從類參考:NSNotificationCenter帖子所有通知同步
另外,如果你願意,你可以使用NSNotificationQueue發佈通知異步
相關問題
- 1. NSNotificationCenter通知不被髮送/接收
- 2. 使用NSNotificationCenter接收通知
- 3. NSNotificationCenter:是否有可能監聽其他未明確發佈通知的類?
- 4. 等待最後一個線程通知他們的線程
- 5. 發佈/接收JSON對象
- 6. 確定哪個對象發佈通知?
- 7. NSNotificationCenter - 等待通知發佈而不阻塞主線程的方式?
- 8. 我們可以廣播一個對象來接收其他類
- 9. 如何發佈和接收通知?
- 10. 發佈不同對象類型的單個通知
- 11. 貝寶IPN通知接收多個通知的同一付款
- 12. NSNotificationCenter:我怎麼知道發佈通知的內容?
- 13. 調用dispatch_queue_t上的執行是否確保它們在同一個線程上?
- 14. 是否有針對WiFi網絡更改的NSNotificationCenter通知?
- 15. NSnotificationCenter postNotificationName誰是接收者?
- 16. 是否同步或異步接收NSNotificationCenter事件?
- 17. 如何在另一個線程上接收NSWorkspace和輔助功能通知
- 18. 在單線程對象上一個接一個地調用不同的操作
- 19. NSNotificationCenter通知在關閉時不被接收
- 20. NSNotificationCenter observer收到不同數量的每次運行的通知
- 21. NSNotificationCenter觀察員沒有收到通知
- 22. NS通知只在同一個對象內發送
- 23. 發送和接收通過相同的套接字,但在不同的線程?
- 24. 通知在不同對象中運行的線程
- 25. 從另一個線程發送通知
- 26. js作爲對象值接收同一對象的上下文
- 27. 檢測是否一個對象穿越在畫布其他對象
- 28. 如何知道這個線程是否是一個UI線程
- 29. 他們在發送和接收什麼格式的同步
- 30. 通知另一個對象中的線程
什麼是IOS簡單的答案? – Forrest 2014-11-27 02:13:31