• 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
Re: Different Dictionaries
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Different Dictionaries


  • Subject: Re: Different Dictionaries
  • From: j o a r <email@hidden>
  • Date: Wed, 14 Jul 2004 19:07:52 +0200

Perform the equality test as stated in the documentation yourself, and
see where it fails:

==============================================================
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.
==============================================================

j o a r

On 2004-07-14, at 18.27, Lorenzo wrote:

> I have some problem with the method isEqualToDictionary. It returns
> that 2
> dictionaries are different while indeed they should be equal.
> I have one only dictionary called memDict.
>
> [memDict writeToFile:path atomically:YES];
> readDict = [NSDictionary dictionaryWithContentsOfFile:path];
>
> if([memDict isEqualToDictionary:readDict]){
> NSLog(@"Dictionaries are Equal");
> }
> else NSLog(@"Dictionaries are NOT Equal");
>
>
> And I got always the log "Dictionaries are NOT Equal".
> It seems that once saved to a file, the readDict dictionary written to
> the
> disk becames different. No matter if I use NSDictionary or
> NSMutableDictionary.
> So, how can I compare if the saved readDict is Equal to the memDict I
> have
> in memory? I need this in order to tell the user to save the changes.

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Different Dictionaries
      • From: Lorenzo <email@hidden>
References: 
 >Different Dictionaries (From: Lorenzo <email@hidden>)

  • Prev by Date: Re: NSTable Newbie Issues
  • Next by Date: Newbie: Apple in the UK
  • Previous by thread: Different Dictionaries
  • Next by thread: Re: Different Dictionaries
  • Index(es):
    • Date
    • Thread