メインスレッドか判別する。

if ([[NSThread currentThread] isMainThread]) {
       NSLog(@"main");
 } else {
       NSLog(@"not main");
 }