In fact, if your app has multiple threads, then you’re almost certainly using
The above code crashes reliably in the
sleep. Why? What we see here is that
removeObserver:does not block until all notifications have been posted. The method can return while a notification is still executing on another thread. Thus, we have a race condition.
Stay up-to-date by subscribing to the Comments RSS Feed for this post.