• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Updated: NSTextView:setString stalls sometimes...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Updated: NSTextView:setString stalls sometimes...
      • From: John Stiles <email@hidden>
References: 
 >NSTextView:setString stalls sometimes... (From: Luc Vandal <email@hidden>)

  • Prev by Date: Re: DoubleClick and Bindings in an NSTableView (Pre 10.4)
  • Next by Date: Re: Updated: NSTextView:setString stalls sometimes...
  • Previous by thread: NSTextView:setString stalls sometimes...
  • Next by thread: Re: Updated: NSTextView:setString stalls sometimes...
  • Index(es):
    • Date
    • Thread