• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Comparing NSDictionary woes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Comparing NSDictionary woes
      • From: mmalc crawford <email@hidden>
  • Prev by Date: Re: beginSheet, doesn't stop NSThread
  • Next by Date: Re: Comparing NSDictionary woes
  • Previous by thread: Re: fortran90 code
  • Next by thread: Re: Comparing NSDictionary woes
  • Index(es):
    • Date
    • Thread