Follow-up to NSDictionary's isEqualToDictionary: method
Follow-up to NSDictionary's isEqualToDictionary: method
- Subject: Follow-up to NSDictionary's isEqualToDictionary: method
- From: Michael James <email@hidden>
- Date: Thu, 25 Mar 2004 20:49:23 -0500
I wrote 2 C functions to manually compare dictionaries and arrays, and
ran my test data through them. It turns out that the reason why
isEqualToDictionary: returns NO is because I have an NSDate in the
dictionary (created with [NSDate date]). Somehow, when it gets
serialized to the file and read back, the 2 dates (the original one
created in code and the one from the XML property list file) differ by
less than a second.
Reading the documentation reveals that when isEqual: is called on
NSDate objects, it detects subsecond differences. My only explanation
for what seems to be happening is that when the NSDate is either
serialized or deserialized, it drops the subsecond data. I don't know
why it would do this, but somehow it is happening.
If I'm wrong, or you know what is happening, please let me know.
Thanks.
- Michael James
_______________________________________________
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.