I watched your screencast of your problem, and it looks quite similar to an issue I faced not long ago. I had a method that initiated a sheet, something like this (assume the existence of certain values):
- (IBAction)beginSheet:(id)sender
{
[[NSApplication sharedApplication] beginSheet:sheet
modalForWindow:[self mainWindow]
modalDelegate:self
didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
contextInfo:self];
}
The sheet didn't contain a text view like yours, but a table view instead. Sometimes the table view would perform perfectly, but other times, its enclosing scroll view would draw its scroll bars incompletely and there would be vast blank areas as an attempt was made to scroll.
I managed to identify that the wonky behavior occurred only when -beginSheet:
was called on a secondary thread.
To remedy this, I took this approach instead:
- (void)beginSheetOnMainThread:(id)sender
{
[[NSApplication sharedApplication] beginSheet:sheet
modalForWindow:[self mainWindow]
modalDelegate:self
didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
contextInfo:self];
}
- (IBAction)beginSheet:(id)sender
{
[self performSelectorOnMainThread:@selector(beginSheetOnMainThread:) withObject:sender waitUntilDone:YES];
}
and the table views behaved consistently, and correctly.
(I subsequently learned that using the dispatch_async() approach with the main queue and a block works quite well, too.)
I apologize for the anecdotal evidence, knowing that this still may not solve your particular problem. But again, having seen your screencast, I found the symptoms quite familiar.