Sorry, I’m not sure of the right language here, but when methods are called because they are either delegate methods, or methods called as a result of being listed as the target of an observer, are they executed on the main thread?
I’m wondering if I can just make UI changes in these methods, or do I have to wrap them in
dispatch_async(dispatch_get_main_queue(), ^{ UI stuff });
TIA: John
For delegates this can vary. If the documentation does not specify, then usually they are sent on the main thread. Traditionally UIKit must be used on the main thread so those delegates will almost always be called from the main thread.
For notifications I think you want this little snip.
From http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/nsnotificationcenter_Class/Reference/Reference.html
And finally for KVO, the notifications can come in from other threads. Here is what an Apple Engineer had to say about handling them.
http://lists.apple.com/archives/cocoa-dev/2007/May/msg00022.html