Sometimes everything you code is correct, just doesn't work all the time. Problem might be that occasionally your
UI update related code is called from non-main thread. This is how to debug which thread you're using:
#include <pthread.h>
- (void)myFunction
{
NSLog(@"Thread (%d)",
pthread_mach_thread_np(pthread_self()));
}
Note to myself, don't forget the INCLUDE! Yep, debugging multi-threaded memory management again.
ReplyDelete