Comparing NSDictionary woes
Comparing NSDictionary woes
- Subject: Comparing NSDictionary woes
- From: Ken Tozier <email@hidden>
- Date: Sun, 22 Jul 2007 17:01:32 -0400
Hi
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.
Next, to mimic that behavior, I tried comparing dictionary
descriptions like so
if ([[dict1 description] isEqualToString: [dict2 description]])
NSLog(@"dict1 and dict2 are equal");
else
NSLog(@"dict1 and dict2 are not equal");
But even that only works about 40 percent of the time. Is there any
reliable way to compare two dictionaries short of defining custom
compare methods for every plist type?
Thanks for any help
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