• 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
Comparing NSEntityDescription instances?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Comparing NSEntityDescription instances?
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Re: Cocoa Books
  • Next by Date: Re: Choose an NSFont with specific line height?
  • Previous by thread: kAEShowAbout ?
  • Next by thread: Re: Comparing NSEntityDescription instances?
  • Index(es):
    • Date
    • Thread