• 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: NSException from [NSTextView setSelectedRange] ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSException from [NSTextView setSelectedRange] ?


  • Subject: Re: NSException from [NSTextView setSelectedRange] ?
  • From: Douglas Davidson <email@hidden>
  • Date: Mon, 19 Jun 2006 09:33:35 -0700


On Jun 19, 2006, at 4:20 AM, Theodore H. Smith wrote:

I sometimes get an NSException when calling [NSTextView setSelectedRange].

My guess is that I'm passing an invalid range.

Can I get NSTextView to correct the range automatically if I pass a range that extends beyond the bounds of the text? I'd rather have it auto-correct ranges, than throw NSExceptions. An exception seems a bit harsh for such a simple mistake :(


An exception is the standard result when an out-of-range argument is passed in--try it with NSArray, for example. You can easily add a new method in a category on NSTextView, say - setSelectedRangeWithTruncation:, that will do what you wish.


Douglas Davidson

_______________________________________________
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


References: 
 >NSException from [NSTextView setSelectedRange] ? (From: "Theodore H. Smith" <email@hidden>)

  • Prev by Date: Re: Problem in simulating the events
  • Next by Date: Re: Stopping an NSRunLoop OR getting NSDistributedNotificationCenter notifications
  • Previous by thread: NSException from [NSTextView setSelectedRange] ?
  • Next by thread: Zlib compress & uncompress
  • Index(es):
    • Date
    • Thread