Re: Updated: NSTextView:setString stalls sometimes...
Re: Updated: NSTextView:setString stalls sometimes...
- Subject: Re: Updated: NSTextView:setString stalls sometimes...
- From: Luc Vandal <email@hidden>
- Date: Tue, 25 Oct 2005 15:45:53 -0400
Yeah, it's a secondary thread. Is there any way to make this work?
Luc
On 25-Oct-05, at 2:56 PM, John Stiles wrote:
Are you making these calls on the main thread? AppKit does not
support GUI calls from secondary threads (and this may be an
example of why not ;) ).
On Oct 25, 2005, at 11:59 AM, Luc Vandal wrote:
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:
40blizzard.com
This email sent to email@hidden
_______________________________________________
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