Comparing NSEntityDescription instances?
Comparing NSEntityDescription instances?
- Subject: Comparing NSEntityDescription instances?
- From: Jim Correia <email@hidden>
- Date: Mon, 17 Apr 2006 21:53:53 -0400
Suppose I have two entity descriptions which are conceptually equal,
but have different pointer values:
NSEntityDescription *entity = [NSEntityDescription entityForName:
entityName inManagedObjectContext: managedObjectContext];
NSEntityDescription *entity2 = [[entity copy] autorelease];
NSLog(@"entities are equal = %d", [entity isEqual: entity2]);
NSLog(@"entities hashes = %d, %d", [entity hash], [entity2 hash]);
They produce identical hash codes, but -isEqual: returns NO.
2006-04-17 21:43:43.639 Test[11091] entities are equal = 0
2006-04-17 21:43:43.639 Test[11091] entities hashes = 1453860666,
1453860666
Normally I'd just figure that the class didn't implement -isEqual:
and move on, but it appears that NSEntityDescription does implement -
isEqual: and -hash.
Am I misunderstanding something fundamental, or is this just a bug?
Thanks,
Jim
_______________________________________________
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