Re: copy & isEqual nightmares
Re: copy & isEqual nightmares
- Subject: Re: copy & isEqual nightmares
- From: Jean-Daniel Dupas <email@hidden>
- Date: Sat, 18 Feb 2012 00:56:35 +0100
Le 17 févr. 2012 à 21:33, Ben Kennedy a écrit :
> On 16 Feb 2012, at 3:54 pm, Ken Thomases wrote:
>
>> In other words, you're being silly. It's clear to everyone that -[NSString isEqual:] must have semantics built on -[NSString isEqualToString:], which is clearly documented.
>
> What value does NSString's isEqualToString: bring to the table over its implementation of isEqual? Is it just a matter of foregoing an 'if ([obj isKindOfClass:[NSString class])' construct at the front end? Put another way, why does NSString provide isEqualToString: as a distinct method?
Please read the doc:
Special Considerations
When you know both objects are strings, this method is a faster way to check equality than isEqual:.
-- Jean-Daniel
_______________________________________________
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