Updated: NSTextView:setString stalls sometimes...
Updated: NSTextView:setString stalls sometimes...
- Subject: Updated: NSTextView:setString stalls sometimes...
- From: Luc Vandal <email@hidden>
- Date: Tue, 25 Oct 2005 14:59:41 -0400
Hi,
turns out the problem is that setString isn't done displaying the
text yet and I try to call setSelectedRange the view will be locked
if( g_sz != NULL )
{
[mainView setString:[NSString stringWithCString:g_sz]];
//sleep( 2 );
[mainView setSelectedRange:NSMakeRange( 1400, 12 )];
[mainView scrollRangeToVisible:NSMakeRange( 1400, 12 )];
[mainView display];
}
If I uncomment sleep(2) everything is fine. What could I use instead
of sleep to know when the view is ready?
Thanks!
Begin forwarded message:
From: Luc Vandal <email@hidden>
Date: October 25, 2005 10:46:39 AM EDT (CA)
To: cocoa Dev <email@hidden>
Subject: NSTextView:setString stalls sometimes...
Hi!
I have a weird problem with setString. Sometimes the function will
never return. Here's the code:
if( g_sz != NULL )
{
[mainView setString:[NSString stringWithCString:g_sz]];
}
g_sz is a large array containing a book. Normally, the first time I
use setString it will work properly but when I try to use setString
afterwards it will not return. However, if I set a breakpoint at
that line then setString always returns. What could cause this
problem?
Luc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden