Re: Different Dictionaries
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.