isEqual: vs isEqualTo:
isEqual: vs isEqualTo:
- Subject: isEqual: vs isEqualTo:
- From: Jens Miltner <email@hidden>
- Date: Thu, 17 Jul 2008 11:20:02 +0200
Hi all,
I'm somewhat confused regarding the difference between the isEqual:
and the isEqualTo: defined in the NSObject interface.
What's the difference and is there a penalty paid when using
isEqualTo: instead of isEqual:?
So far, I've been mostly using isEqualTo: since it was the intuitive
thing to write (having well internalized the Cocoa naming scheme ;-)
I'm now a little concerned whether this might have side effects
compared to using isEqual: ...
From the documentation, I can't really tell whether there are just
two separate implementations or whether one just calls the other - I
can only assume that isEqual: is the actual implementation, whereas
isEqualTo: , since it's declared in NSScriptWhoseTests.h was really
added for scripting support, but IMHO, it doesn't make sense to add a
new name (which, BTW, isn't even scripting specific) just for this, so
I also have to assume that it's really just an alias for isEqual:,
i.e. it just calls isEqual: in the default implementation(s)?
Why would one have to methods that apparently don't do things really
differently and which both seem to be generic enough to not be tied to
a certain operational area (like e.g. scriptingIsEqualTo:, which
obviously is tied to scripting support)?
If anybody could shed some light on this, I'd really appreciate.
Thanks,
-jens
verinnerlicht
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden