5
votes

I am using mogenerator.I am getting CoreData error as follows:

Failed to call designated initializer on NSManagedObject class 'ClassName'.

Anybody please help me to solve this error.

3

3 Answers

16
votes

Don't alloc / initalise something that you already have a hand on.. that's why !

Example of use in a cellForRowAtIndexPath

Use ClassName *class = [arrayOfSomething objectAtIndex:indexPath.row];

Instead of ClassName *class = [ClassName alloc] init]; class = [arrayOfSomething objectAtIndex:indexPath.row]

2
votes

You need to show the associated code before anyone can assist. Otherwise we are just guessing.

Show how you are initializing ClassName.

2
votes

Do not alloc init your Bean class, instead use following method to set Bean:

-(void)setBean:(YourBeanClassName *)obj
{
    objBean = obj;
}