Is there a way to fire NSNotification (that potentially triggers a fair amount of work) without delaying any currently completing code?
Specifically, I have a UIPanGestureRecognizer which allows the user to pan through months, January, February, etc. Once the user lifts their finger (recognizer state changes UIGestureRecognizerStateEnded) there is some clean up code run, including some UI (adjusting a frame, etc), and -- importantly -- an NSNotification fired with the selected month.
This works smoothly in the Simulator, but when run on my iPhone 4, the performance is terrible (i.e. when I lift my finger, the UI locks up for +1.5 seconds). If I remove the notification, the performance is back to being good. Please note that these notifications are being sent all over the app (synchronizing a month-based calendar, a week-based calendar and an event list) and have shown no performance problems until now. It's only at this point when they are being used with the gesture recognizer that performance becomes an issue.