Monday, July 24, 2017 [Tweets] [Favorites]

NSNotificationCenter Thread Safety

Jeff Johnson:

As far as I can tell, NSNotificationCenter now keeps a strong reference to the observer while posting a notification. As a consequence, the observer can no longer deallocate while processing the notification. This behavior occurs both with Automatic Reference Counting (ARC) and with Manual Retain-Release (MRR). Hooray!

It’s still true that removeObserver: does not block for notifications in progress.

Comments

Stay up-to-date by subscribing to the Comments RSS Feed for this post.

Leave a Comment