Re: NSOldSelectedCharacterRange output is funky
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.