I’m trying to use “insertNewObjectForEntityForName”, but I’ve got a problem with my declaration, I wondered if someone had an opinion on this .
This is my implementation :
NSManagedObjectContext *context = [(AppDelegate *)[[UIApplication sharedApplication] delegate] managedObjectContext];
// Create Object
Shots *newShot = (Shots *)[NSEntityDescription insertNewObjectForEntityForName:@"Shots" inManagedObjectContext:context];
It’s complaining that “Shots” is undeclared, now my question is : Do I need to declare a new class for Shots ? Knowing that it appears as a NSManagedObject in the dataModeler ?


No, you do not need to write your own “Shots” class. In which case, use “NSManagedObject” as the data type instead. It’ll respond to accessing the Shots data fields.
You can write a Shots class, it will have NSManagedObject as its base class, if you need to implement model behavior particular to the Shots objects.