Re: Using isMemberOfClass with a tree of subclass of NSManagedObject

2008-06-29 Thread Yoann GINI
Okey, I've solve the problem ! It's very simple, I've only load the in NSManagedObjectModel the mom file represent the modification base, not the main model... Now I load all mom file and it's work ! Thanks all Le 29 juin 08 à 01:27, Bill Bumgarner a écrit : On Jun 28, 2008, at 1:08 PM,

Using isMemberOfClass with a tree of subclass of NSManagedObject

2008-06-28 Thread Yoann GINI
Hi all, 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

Re: Using isMemberOfClass with a tree of subclass of NSManagedObject

2008-06-28 Thread Owen Yamauchi
On Sat, Jun 28, 2008 at 9:58 AM, Yoann GINI [EMAIL PROTECTED] wrote: Do you have an idea ? Use -isKindOfClass: instead. -isMemberOfClass: only tells you if an object is an instance of that specific class. -isKindOfClass: includes all superclasses as well. Owen [forgot to reply-all]

Re: Using isMemberOfClass with a tree of subclass of NSManagedObject

2008-06-28 Thread Yoann GINI
Ho sorry, of cours it's isKindOfClass, I've this problem since 2 days and I've try all similar method by despair ! With isKindOfClass I've always a NO in return... Le 28 juin 08 à 19:15, Owen Yamauchi a écrit : On Sat, Jun 28, 2008 at 9:58 AM, Yoann GINI [EMAIL PROTECTED] wrote: Do

Re: Using isMemberOfClass with a tree of subclass of NSManagedObject

2008-06-28 Thread Mike Abdullah
Post some code. Mike. On 28 Jun 2008, at 18:25, Yoann GINI wrote: Ho sorry, of cours it's isKindOfClass, I've this problem since 2 days and I've try all similar method by despair ! With isKindOfClass I've always a NO in return... Le 28 juin 08 à 19:15, Owen Yamauchi a écrit : On Sat,

Re: Using isMemberOfClass with a tree of subclass of NSManagedObject

2008-06-28 Thread mmalc crawford
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

Re: Using isMemberOfClass with a tree of subclass of NSManagedObject

2008-06-28 Thread Yoann GINI
A part of code (this is a simply try code for a RD): @interface root : NSManagedObject @interface song : root @interface artist : root @interface modification : NSManagedObject -(void)dataBaseHaveChange:(NSNotification*)notification//I receive here the notification of a CoreData

Re: Using isMemberOfClass with a tree of subclass of NSManagedObject

2008-06-28 Thread Yoann GINI
This doesn't work with isKindOfEntity, used like that : NSEntityDescription* rootDescription = [[NSEntityDescription entityForName:@root inManagedObjectContext:[self managedObjectContext]] retain]; ... [rootDescription isKindOfEntity:[modEntry entity]] It's always return NO...

Re: Using isMemberOfClass with a tree of subclass of NSManagedObject

2008-06-28 Thread Bill Bumgarner
On Jun 28, 2008, at 10:58 AM, Yoann GINI wrote: @interface root : NSManagedObject @interface song : root @interface artist : root @interface modification : NSManagedObject Obj-C classes start with a capital letter, by convention. So -- Root, Song, Artist, and Modification would be

Re: Using isMemberOfClass with a tree of subclass of NSManagedObject

2008-06-28 Thread mmalc crawford
On Jun 28, 2008, at 11:07 AM, Yoann GINI wrote: @interface root : NSManagedObject @interface song : root @interface artist : root @interface modification : NSManagedObject This doesn't work with isKindOfEntity, used like that : NSEntityDescription* rootDescription = [[NSEntityDescription

Re: Using isMemberOfClass with a tree of subclass of NSManagedObject

2008-06-28 Thread Yoann GINI
Answer for the other mail (from Bill) : Yes, my objectsSet contain my object, and when I display the class type of this object in a NSLog I obtain the good thing (artist, song, modification). Sorry for the conventions, this is just a test code... root is the name of the class used for the

Re: Using isMemberOfClass with a tree of subclass of NSManagedObject

2008-06-28 Thread Yoann GINI
Nota : userInfo pointer of kind NSNotification is a mistake, it's a NSDictionary of course. Le 28 juin 08 à 19:58, Yoann GINI a écrit : A part of code (this is a simply try code for a RD): @interface root : NSManagedObject @interface song : root @interface artist : root @interface

Re: Using isMemberOfClass with a tree of subclass of NSManagedObject

2008-06-28 Thread Kyle Sluder
On Sat, Jun 28, 2008 at 2:14 PM, Bill Bumgarner [EMAIL PROTECTED] wrote: You want -objectForKey: -valueForKey: is for key value coding, -objectForKey: is for extracting objects from a dictionary. Shouldn't cause a problem. I thought the collection classes were smart and treated -valueForKey:

Re: Using isMemberOfClass with a tree of subclass of NSManagedObject

2008-06-28 Thread Bill Bumgarner
On Jun 28, 2008, at 1:08 PM, Kyle Sluder wrote: On Sat, Jun 28, 2008 at 2:14 PM, Bill Bumgarner [EMAIL PROTECTED] wrote: You want -objectForKey: -valueForKey: is for key value coding, -objectForKey: is for extracting objects from a dictionary. Shouldn't cause a problem. I thought the

valueForKey: on collections [was: Re: Using isMemberOfClass with a tree of subclass of NSManagedObject]

2008-06-28 Thread Ben Trumbull
On Jun 28, 2008, at 1:08 PM, Kyle Sluder wrote: On Sat, Jun 28, 2008 at 2:14 PM, Bill Bumgarner [EMAIL PROTECTED] wrote: You want -objectForKey: -valueForKey: is for key value coding, -objectForKey: is for extracting objects from a dictionary. Shouldn't cause a problem. I thought the

Re: valueForKey: on collections [was: Re: Using isMemberOfClass with a tree of subclass of NSManagedObject]

2008-06-28 Thread Owen Yamauchi
On Sat, Jun 28, 2008 at 6:24 PM, Ben Trumbull [EMAIL PROTECTED] wrote: Which is, frankly, a bit goofy and, thus, the primary reason why I would avoid using -valueForKey: on a dictionary. Amen. It's slower, and people reading your code can get very confused. Then is there a recommended way of

Re: valueForKey: on collections [was: Re: Using isMemberOfClass with a tree of subclass of NSManagedObject]

2008-06-28 Thread Kyle Sluder
On Sat, Jun 28, 2008 at 9:35 PM, Owen Yamauchi [EMAIL PROTECTED] wrote: On Sat, Jun 28, 2008 at 6:24 PM, Ben Trumbull [EMAIL PROTECTED] wrote: Which is, frankly, a bit goofy and, thus, the primary reason why I would avoid using -valueForKey: on a dictionary. Amen. It's slower, and people