Re: Re: Respond to Click in TextView
Re: Re: Respond to Click in TextView
- Subject: Re: Re: Respond to Click in TextView
- From: "Michael Ash" <email@hidden>
- Date: Mon, 28 Aug 2006 18:26:55 -0400
On 8/28/06, Michael Terry <email@hidden> wrote:
> In the end it's possible that the notification approach would end up
> being overcomplicated, but from where I see it now, it seems like the
> better way.
Ok, good, that's what I'll do, if I do do it. Everything I read takes
such pains to warn me off of subclassing that I'm dreading ever
having to.
Don't dread it, it's not that bad. It's really not much harder than
using a notification or a delegate, except that you usually already
have a class sitting around that can serve as the delegate, whereas
with a subclass you have to make a new one. But that's not much of a
hardship.
The main disadvantage is that it's often less clear how to do what you
want, and the design can get uglier. With a delegate, you have a nice
list of the methods you can implement and what they do, and it's kept
in a separate class. If you subclass, you have a large list of
methods, some of which make be vague or confusing, and you kind of
have to make your own way. When given a choice, I almost always prefer
to use a delegate or notification, but if there's no choice then it's
nothing to worry about.
Mike
_______________________________________________
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