The problem I’m having is that i can’t assign to an attribute of a subclass unless i’ve set the subclassed entity’s Parent Entity property to the entity of the abstract superclass.
In XCode 4.0.2, this is the Parent Entity property to which i’m referring:

What i don’t get is that i thought a Parent Entity is intended for parent-child relationships between entities and the object relationships are simply captured by the class definitions.
Example
Entities A, B and C:
- A is an abstract entity of type A with attributes:
- y : string
- z : string
- B is an entity of type A with no attributes
- C is an entity of type A with no attributes
Classes A, B and C:
@interface A : NSManagedObject {
}
@property (nonatomic, retain) NSString * y;
@property (nonatomic, retain) NSString * z;
@interface B : A {
}
@interface C : A {
}
The Problem
If i don’t set the Parent Entity for entities B and C to be entity A, then when i try:
NSEntityDescription *be = [[mom entitiesByName] objectForKey:@"B"];
B *b = [[NSManagedObject alloc] initWithEntity:be
insertIntoManagedObjectContext:moc];
b.y = @"test"; // <<-- This line causes the following error:
I get:
-[NSManagedObject setY:]: unrecognized selector sent to instance
If i set the Parent Entity, it seems to work except that entity persisted to the store seems to be A instead of B.
Did you remember to set the class for entity B to class B? If yes, you should take a look at the type of the pointer that’s assigned to
b… is it in fact a B*? It looks like it’s probably a NSManagedObject* based on the error you’re getting, and according to the docs for-initWithEntity:insertIntoManagedObjectContext:……I think you should be getting a B* if your model is configured correctly.