Re: Comparing NSDictionary woes
Re: Comparing NSDictionary woes
- Subject: Re: Comparing NSDictionary woes
- From: Ken Tozier <email@hidden>
- Date: Sun, 22 Jul 2007 20:14:51 -0400
On Jul 22, 2007, at 7:53 PM, mmalc crawford wrote:
On Jul 22, 2007, at 4:46 PM, Ken Tozier wrote:
Do they? Have you tested?
If they are identical in the printout, wouldn't that mean they are
equal?
No, exactly as specified by the isEqual: test I referred to in my
first reply and as amplified by Chris in his.
-> <http://developer.apple.com/documentation/Cocoa/Reference/
Foundation/Protocols/NSObject_Protocol/Reference/NSObject.html#//
apple_ref/occ/intfm/NSObject/isEqual:>
I guess I'm getting confused about why comparing two dicts with
isEqual would return different results than isEqualToDictionary
The description from NSDictionary's isEqualToDIctionary method states:
"Two dictionaries have equal contents if they each hold the same
number of entries and, for a given key, the corresponding value
objects in each dictionary satisfy the isEqual: test."
And the description from NSObject's isEqual method states:
"For example, a container object might define two containers as equal
if their corresponding objects all respond YES to an isEqual: request."
Basically the same thing, at least with respect to comparing the
contained items.
Ken
_______________________________________________
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