Если вы используете iOS 4.0 или более позднюю версию, вы можете использовать следующее
dispatch_async(dispatch_get_main_queue(), ^{
[self setNeedsDisplayInRect:theRect];
});
В iOS 3.2 и более ранних версиях вы можете настроить NSInvocation и запустить его в основном потоке:
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:@selector(setNeedsDisplayInRect:)]];
[invocation setTarget:self];
[invocation setSelector:@selector(setNeedsDisplayInRect:)];
// assuming theRect is my rect
[invocation setArgument:&theRect atIndex:2];
[invocation retainArguments]; // retains the target while it's waiting on the main thread
[invocation performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:YES];
Возможно, вы захотите установить для waitUntilDone значение NO, если вам абсолютно не нужно ждать завершения этого вызова, прежде чем продолжить.