• 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: Out of bounds exception from NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Out of bounds exception from NSTextView


  • Subject: Re: Out of bounds exception from NSTextView
  • From: Satoshi Matsumoto <email@hidden>
  • Date: Fri, 02 Sep 2005 07:43:30 +0900

My message posted on yesterday 10:26 am JST was lost while the list server
had been down for 17 hours.   So I post this again.

-------

on 05.9.1 9:41 AM, Brant Sears at email@hidden wrote:
> I'm calling insertText: with an NSString on an NSTextView. I'm getting an
> exception when I do this with a long string (20496 in length). Is there a way
> to tell that a string is too big before you try to call insertText:? The
> appKit reference doesn't even say that it might raise an exception.
>
> The exception says NSRunStorage beyond bounds (2000).
> What is the right thing to do to avoid this?

I don't know whether insertText: has a maximum limit or not.

But please try to use the method replaceCharactersInRange: for the
textStorage as below.

    NSRange range = [myTextView  selectedRange];
    [myTextView shouldChangeTextInRange:range replacementString:string];
    [[myTextView textStorage] replaceCharactersInRange:range
withString:string];
    [myTextView didChangeText];

Satoshi
-----------------------------------------------------
Satoshi Matsumoto <email@hidden>
816-5 Odake, Odawara, Kanagawa, Japan 256-0802


 _______________________________________________
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: Out of bounds exception from NSTextView
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: NSTableView Scrollbars are very quirky on 10.3!
  • Next by Date: Re: Out of bounds exception from NSTextView
  • Previous by thread: RE: Out of bounds exception from NSTextView
  • Next by thread: Re: Out of bounds exception from NSTextView
  • Index(es):
    • Date
    • Thread