Re: isEqualToArray: returning NO for equal arrays
Re: isEqualToArray: returning NO for equal arrays
- Subject: Re: isEqualToArray: returning NO for equal arrays
- From: Rosyna <email@hidden>
- Date: Thu, 2 Nov 2006 18:38:01 -0700
With someone's help and more looking into it, it seems
isEqualToArray: fails because isEqual: fails if comparing an
immutable and mutable dictionary. If both NSDictionarys are
immutable, then isEqual: succeeds. I have *no* idea why isEqual:
fails if the mutability is different, but the contents are identical.
Ack, at 11/3/06, Marc Wan said:
NSArray isEqualToArray compares two arrays to see if the values
are the same by using the isEqual method. I'm not 100% sure here
how deep/rich the Foundation Framework is, but I would suspect that
the problem is that the NSDictionary isEqual method only returns
TRUE/YES if they're actually the same object (which is why they
implemented the isEqualToDictionaryMethod). Somewhere there, a
method is comparing object pointers and not the underlying values.
--
Sincerely,
Rosyna Keller
Technical Support/Carbon troll/Always needs a hug
Unsanity: Unsane Tools for Insanely Great People
It's either this, or imagining Phil Schiller in a thong.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden