[iphone]NSNotificationCenter多线程的情况

 In a multithreaded application, notifications are always delivered in the thread in which the notification was posted, which may not be the same thread in which an observer registered itself.

 

这句话是说,notification都是在post时的线程中被传递和接收,即使add observer时是在另外一个线程中。

 

例如: A, B两个线程都addObserver。如果A中post,则无论此时B线程是否退出,回调都在A中触发,且触发2次。

你可能感兴趣的:([iphone]NSNotificationCenter多线程的情况)