• 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: NSOldSelectedCharacterRange output is funky
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOldSelectedCharacterRange output is funky


  • Subject: Re: NSOldSelectedCharacterRange output is funky
  • From: Douglas Davidson <email@hidden>
  • Date: Mon, 12 May 2003 10:05:26 -0700

On Saturday, May 10, 2003, at 9:59 AM, Philippe Hausler wrote:

- (void)someTextGotChanged:(NSNotification *)aNotification
{
NSLog(@"Text changed");
NSLog(NSStringFromRange([[[aNotification userInfo] objectForKey:
@"NSOldSelectedCharacterRange"] rangeValue]));
NSLog(NSStringFromRange([[aNotification object] selectedRange]));
}

When the notification fires the selected range is valid, but the old
selected range is either an absurdly high number or its {1, 1} and in
both cases its nowhere near the previously selected text before the
change. No matter the action preformed, the result is reproducible so I
don't think its an invalid pointer to data. Is this the right way of
accomplishing this? Are there any other ways of getting the changes
made into a NSTextView if all that is available are notifications?

Which notification are you receiving here? NSOldSelectedCharacterRange is available only with NSTextViewDidChangeSelectionNotification.

Douglas Davidson
_______________________________________________
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: 
 >NSOldSelectedCharacterRange output is funky (From: Philippe Hausler <email@hidden>)

  • Prev by Date: Re: self release
  • Next by Date: Re: self release
  • Previous by thread: NSOldSelectedCharacterRange output is funky
  • Next by thread: Top five reasons your NSTableView doesn't respond to double clicks
  • Index(es):
    • Date
    • Thread