• 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: Wisdom of overriding isEqual:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Re: Wisdom of overriding isEqual: (From: Dustin Voss <email@hidden>)

  • Prev by Date: [Maybe OT] Selling Source Code
  • Next by Date: stylistic question (dotted outline)
  • Previous by thread: Re: Wisdom of overriding isEqual:
  • Next by thread: Re: Wisdom of overriding isEqual:
  • Index(es):
    • Date
    • Thread