Monday, July 24, 2017

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 RSS · Twitter

Leave a Comment