I just started with CoreData yesterday, and I\'m going crazy :( I created a project that uses CoreData (ticked the box -use CoreData). Created the entities, and then created the
I found that by having relations to entities I had to make sure some of my relations would be to-many, I took a screenshot so you can see what I mean, a to-many relation is indicated by the double ended arrow
Two possible problems
Do you have corresponding @dynamic block in the .m file for these properties and
Dont use Capitalised properties, coding conventions are that properties are lowercase for the first letter at least so that when the compiler synthesises the methods.
@property (nonatomic, retain) NSString * type;
in .h
and
@dynamic type;
in .m
becomes something like
-(void)setType:(NSString *)atype
{
....
[self willChangeValueForKey:@"type"];
[self setPrimitiveValue:atype forKey:@"type"];
[self didChangeValueForKey:@"type"];
}
-(NSString *)type
{
return [self primitiveValueForKey:@"type"];
}
in the background. Though you cant see that code ever.
Case conventions are up to you but Camel Caps is nominally normal with Cocoa. But its much like an object such as Big Furry Cat
becomes bigFurryCat
. Follow the style in the apple examples.
EDIT - change @synthesize to @dynamic