NSNotificationCenter: Do objects receive notifications on the same thread they are posted?

后端 未结 2 421
予麋鹿
予麋鹿 2020-12-31 02:47

I am interested in knowing whether I can expect the observing object\'s method to be pushed onto the stack before the posting object\'s method has been completed and removed

2条回答
  •  被撕碎了的回忆
    2020-12-31 03:16

    Just bothered to look it up myself, shameful:

    From the class reference: NSNotificationCenter posts all notifications synchronously

    Also, if you prefer, you can use NSNotificationQueue to post notifications asynchronously

提交回复
热议问题