I am getting the following error:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Illegal container for relationship: value = (
"<CVStar: 0x6a2e990> (entity: CVStar; id: 0x6a2e980 <x-coredata:///CVStar/t20E391D3-6FA6-4521-84FE-EAA9469E012029> ; data: {\n \"date_created\" = \"1312050431.973905\";\n message = nil;\n user = \"0x6a2be10 <x-coredata:///CVLogin/t20E391D3-6FA6-4521-84FE-EAA9469E012030>\";\n})",
"<CVStar: 0x6a2aca0> (entity: CVStar; id: 0x6a2b0d0 <x-coredata:///CVStar/t20E391D3-6FA6-4521-84FE-EAA9469E012031> ; data: {\n \"date_created\" = \"1312011314.591517\";\n message = nil;\n user = \"0x6a36490 <x-coredata://B8EAEF54-AC90-46F0-B442-93077B937C3F/CVLogin/p28>\";\n})"
); relationship = "stars".'
Any idea on how to debug this? I have a class CVMessage which has an NSArray of CVStar.. I’ve setup a relationship on the model from CVMessage as a one to many to CVStar (A CVMessage can have many CVStar). This however doesn’t work, how is this even possible?
Here’s some code:
@class CVLogin;
@class CVTopic;
@interface CVMessage : NSManagedObject {
}
@property (nonatomic, retain) NSNumber * date_created;
@property (nonatomic, retain) NSString * message;
@property (nonatomic, retain) NSNumber * mid;
@property (nonatomic, retain) CVLogin * creator;
@property (nonatomic, retain) NSArray * stars;
@property (nonatomic, retain) NSArray * embeds;
@property (nonatomic, retain) CVTopic * topic;
@property (nonatomic, assign) BOOL options;
@end
@interface CVStar : NSManagedObject {
}
@property (nonatomic, retain) NSNumber * date_created;
@property (nonatomic, retain) CVLogin * user;
@end
some screenshots if it helped

NSManagedObjects cannot have NSArray as a property type, since Core Data does not support it. Instead, use NSSet, which should describe a relationship. If you must have ordered data, then add a property which describes the order of your objects. Also, keep in mind that Core Data is much more than a persistent store, and is not a SQL database. You’ll do much better if you don’t think of things as rows and columns, but rather as objects.