Re: Wisdom of overriding isEqual:
Re: Wisdom of overriding isEqual:
- Subject: Re: Wisdom of overriding isEqual:
- From: Bill Cheeseman <email@hidden>
- Date: Thu, 11 Mar 2004 15:39:34 -0500
on 2004-03-11 2:54 PM, Dustin Voss at email@hidden wrote:
>
> I think you are referring to
>
> <http://developer.apple.com/documentation/Cocoa/Conceptual/
>
> CocoaObjects/Articles/Introspection.html>.
>
>
Just a note, but from reading the above Introspection document, I see
>
no signs that the default implementation of isEqual: calls isEqualToX:
Right. I'm not sure "default" is the right word, though, because you either
write something like this or you don't. If there is a "default," it is the
NSObject implementation of -isEqual:, which isn't very useful for most kinds
of data in collection objects.
What I would say is this: it appears to be a pervasive pattern in Foundation
data classes to have an -isEqualTo...: method, and the example code in the
document makes clear that this is a very sensible and useful way to write an
-isEqual: and -isEqualTo...: pair.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
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.