Failed to call the designated initializer in class NSManagedObject 'ClassName'

I am using mogenerator. I get a CoreData error as follows:

Failed to call the designated initializer in class NSManagedObject 'ClassName'.

Someone please help me resolve this error.

+6
objective-c iphone core-data
source share
3 answers

Do not highlight / initalise what you already have. That's why!

Usage example in cellForRowAtIndexPath

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

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

+16
source share

You need to show the related code before anyone can help. Otherwise, we just guess.

Show how you initialize ClassName .

+2
source share

Do not allocate init to your Bean class, but use the following method to install Bean:

 -(void)setBean:(YourBeanClassName *)obj { objBean = obj; } 
+2
source share

All Articles