How Not to Crash #3: NSNotification
I have one simple, hard-and-fast rule: NSNotifications are posted on the main thread only. No exceptions. If some code is running in another thread and it needs to post a notification, it does so on the main thread.
[…]
Your notification handlers should be written so that they can deal with getting called twice. And it should be impossible for a given object to register twice for the same notification. Both.
1 Comment RSS · Twitter
August 26, 2015 8:50 PM
[…] Previously: NSNotificationCenter With Blocks Considered Harmful, How Not to Crash #3: NSNotification. […]