• 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
Re: NSTextView scrolling problem...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView scrolling problem...


  • Subject: Re: NSTextView scrolling problem...
  • From: Mike Masukawa <email@hidden>
  • Date: Mon, 9 Dec 2002 07:33:45 -0800

I use length-1 and it seems to work everytime.

On Monday, December 9, 2002, at 07:13 AM, Nico wrote:

Hi there.

I've got a subclass of NSTextView in a document inside a doc-based app.
As I append some text to this NSTextView very often, I need the end of the textview to be visible everytime.
For that, at the end the method called (in the subclass) to add text to the textview, I call :
[self scrollRangeToVisible:NSMakeRange([[[self textStorage] string] length], 0)];

or even
[self scrollRangeToVisible:NSMakeRange([[self string] length], 0)];

(The method containing this line is called dozens time a second and contains a few lines colorizing and parsing the text).

Whatever, sometimes, very randomly, I'd say 5% of the time, I got an error message :
'NSRangeException' (reason '*** NSRunStorage, _NSBlockNumberForIndex(): index (25436) beyond array bounds (24954)')

and the debugger pauses the app, showing me the line above......

What's the problem over there ?
Any help is very appreciated !

Nico.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >NSTextView scrolling problem... (From: Nico <email@hidden>)

  • Prev by Date: NSTextView scrolling problem...
  • Next by Date: Re: basic Obj-C lesson (was runtime error with NSArray no
  • Previous by thread: NSTextView scrolling problem...
  • Next by thread: Re: NSTextView scrolling problem...
  • Index(es):
    • Date
    • Thread