1. 通过performSelectorOnMainThread
[self performSelectorOnMainThread:@selector(updateUIWith:)
withObject:[UIColor greenColor] waitUntilDone:YES
modes:[NSArray arrayWithObject:(__bridge NSString*)kCFRunLoopCommonModes]];
2. 通过NSOperationQueue 调度到mainQueue
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
[self updateUIWith:[UIColor greenColor]];
}];
3. 通过gcd调度到主队列
dispatch_async(dispatch_get_main_queue(), ^{
[self updateUIWith:[UIColor greenColor]];
});