Coredata: error: failed to call designed initializer on nsmanagedobject

first put a breakpoint (remember global breakpoints, so you can detect when something breaks) and then I know that my own class is writing

TTCourse *course=[[TTCourse alloc]init]; This is a problem, after is – [TTCourse setCourseID:] : unrecognized selector that sent to instance 0 x7fa392ecb080 this mistake, and then I looked at it inherited type is NSManagedObject, so initialization must use this type of initialization, namely insertNewObjectIntoContext this method.

TTCourse *course = [TTCourse insertNewObjectIntoContext:[TTImporter sharedInstance].context]; [TTImportersharedInstance].0 context. You can just write your own context.



Also, here’s a more recognized selector sent to instance

>

>

Read More: