Code:
NSManagedObjectContext *context = [app managedObjectContext];
Objects *objects = (Objects*)[NSEntityDescription insertNewObjectForEntityForName:@"Objects" inManagedObjectContext:context];
objects.objectNaam = textfieldNaam.text;
objects.objectBeschrijving = textfieldBeschrijving.text;
NSError *error;
if(![context save:&error])
{
NSLog(@"ERROR");
}
else{
NSLog(@"Added");
}
// save the changes if needed and change views to noneditable
}
Error:
2012-07-27 19:23:39.211 Choose3[6517:fb03] *** NSInvocation: warning: object 0x18f6500 of class 'Object' does not implement methodSignatureForSelector: -- trouble ahead
2012-07-27 19:23:39.212 Choose3[6517:fb03] *** NSInvocation: warning: object 0x18f6500 of class 'Object' does not implement doesNotRecognizeSelector: -- abort
I have a Core Data Generated Class, Objects.h (originally Object.h, changed it to Objects because maybe it had something to do with reserved words) and three other NSManagedObject Subclasses (Actor, Operation and Goal)
Tried in this line:
Code:
Objects *objects = (Objects*)[NSEntityDescription insertNewObjectForEntityForName:@"Objects" inManagedObjectContext:context];
Someone an idea ?