Improving assertion error when attempting to configure an entity mapping for an entity with a nil managed object class

This commit is contained in:
Blake Watters
2012-08-13 14:14:36 -04:00
parent 3dd0b722b3
commit 975e1674a2

View File

@@ -65,7 +65,7 @@ BOOL RKObjectIsValueEqualToValue(id sourceValue, id destinationValue);
{
NSAssert(entity, @"Cannot initialize an RKEntityMapping without an entity. Maybe you want RKObjectMapping instead?");
Class objectClass = NSClassFromString([entity managedObjectClassName]);
NSAssert(objectClass, @"The managedObjectClass for an object mapped entity cannot be nil.");
NSAssert(objectClass, @"Cannot initialize an entity mapping for an entity with a nil managed object class: Got nil class for managed object class name '%@'. Maybe you forgot to add the class files to your target?", [entity managedObjectClassName]);
self = [self init];
if (self) {
self.objectClass = objectClass;