• 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
Re: Using isMemberOfClass with a tree of subclass of NSManagedObject
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using isMemberOfClass with a tree of subclass of NSManagedObject


  • Subject: Re: Using isMemberOfClass with a tree of subclass of NSManagedObject
  • From: mmalc crawford <email@hidden>
  • Date: Sat, 28 Jun 2008 10:32:12 -0700

On Jun 28, 2008, at 10:15 AM, Owen Yamauchi wrote:

On Jun 28, 2008, at 9:58 AM, Yoann GINI wrote:
I've a CoreData base with some kind of object what are a subclass of an abstract class called "root" (root is a subclass of NSManagedObject). In a part of my code I need to catch all operation on object what are a child of root. For do that I use the notification NSManagedObjectContextObjectsDidChangeNotification and I would use "isMemberOfClass" method for test each objet. I don't know why but this method always return "NO" even of an object what are a chlid of root...

Use -isKindOfClass: instead. -isMemberOfClass: only tells you if an
object is an instance of that specific class. -isKindOfClass: includes
all superclasses as well.

isKindOfClass: includes all *subclasses* as well.

You should almost certainly, though, not be using class-based tests -- you should instead test the entity of the managed object (if you need to test for subentities, use isKindOfEntity).

mmalc

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Using isMemberOfClass with a tree of subclass of NSManagedObject
      • From: Yoann GINI <email@hidden>
References: 
 >Using isMemberOfClass with a tree of subclass of NSManagedObject (From: Yoann GINI <email@hidden>)

  • Prev by Date: Re: Why aren't my bindings firing?
  • Next by Date: noob question regarding proxy object returned by -selection method of NSArrayController
  • Previous by thread: Re: Using isMemberOfClass with a tree of subclass of NSManagedObject
  • Next by thread: Re: Using isMemberOfClass with a tree of subclass of NSManagedObject
  • Index(es):
    • Date
    • Thread