Subclassing NSTextView under Tiger
Subclassing NSTextView under Tiger
- Subject: Subclassing NSTextView under Tiger
- From: Keith Blount <email@hidden>
- Date: Mon, 8 Aug 2005 02:29:04 -0700 (PDT)
Hello,
I have an NSTextView subclass that deals with things
like image resizing, live word count,
auto-capitalisation, annotations etc. In order to
implement some of these features, I have overridden:
-shouldChangeTextInRange:replacementString:
However, under Tiger, with its support for multiple
text selections, a new equivalent method has been
introduced for multiple selections:
-shouldChangeTextInRanges:replacementStrings:
Does anybody know where my override code now belongs?
Currently I have left it in the original (single)
method, and it seems to be working. But even NSLogging
in the two methods I am a bit confused as to the
relationship between the two methods. I had assumed
that the multiple method would call the single method
multiple times, or that the single method would call
the multiple method once, but this does not seem to be
the case.
Do I need to put my code in both methods, or only in
one - and if so, which one? If anybody could clarify
how these methods work with one another, and how a
subclass should handle overriding them so as to avoid
any pitfalls, I would be very grateful.
Many thanks in advance,
Keith
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
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