Re: Comparing NSDictionary woes
Re: Comparing NSDictionary woes
- Subject: Re: Comparing NSDictionary woes
- From: mmalc crawford <email@hidden>
- Date: Sun, 22 Jul 2007 14:13:07 -0700
On Jul 22, 2007, at 2:01 PM, Ken Tozier wrote:
I'm trying to compare two dictionaries and am getting [dict1
isEqualToDictionary: dict2] = NO when they are exactly the same. If
I NSLog each dictionary cut, paste their descriptions into separate
BBEdit files and do a diff, BBEdit says they are identical.
Why are you comparing string representations?
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/Reference/Reference.html#//apple_ref/occ/instm/NSDictionary/isEqualToDictionary:
>
"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."
Do your objects satisfy that test?
mmalc
_______________________________________________
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