Code:
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@\"A\"
From Core Data Programming Guide
You are discouraged from overriding description—if this method fires a fault during a debugging operation, the results may be unpredictable—and initWithEntity:insertIntoManagedObjectContext:. You should typically not override the key-value coding methods such as valueForKey: and setValue:forKeyPath:.
-description
is a method in NSObject that returns a string representation of your object. In the line NSLog(@"%@", object)
, -description
is used to get the string that you see in the console. Key-value coding will end up using the method to get the property for the description attribute. This causes a whole lot of confusion to Core Data.
The programming guide is being generous when it says "discouraged". They really mean "Yeah, it's going to break your stuff."
That link also has a good list of other methods that will break your stuff if you override them.