Question: I'm relatively well versed in CoreData and have been using it for several years with little or no difficulty. For the life of me, I can't figure out why

```
insertNewObjectForEntityForName:inManagedObjectContext:

```

is all of a sudden returning some sort of strange instance of NSNumber. GDB says the returned object is of the correct custom subclass of NSManagedObject, but when I go to print a description of the NSManagedObject itself, I get the following error:

```
*** -[NSCFNumber objectID]: unrecognized selector sent to instance 0x3f26f50

```

What's even stranger, is that I'm able to set some relationships and attributes using setValue:forKey: and all is good. But when I try to set one specific relationship, I get this error:

```
*** -[NSCFNumber entity]: unrecognized selector sent to instance 0x3f26f50

```

I've tried everything from clean all targets, to restarting both mac and iPhone, even editing the model so that the relationship in question is to-one instead of to-many. No matter what I do, the same problem appears. Has anyone ever seen anything like this before?

Answer: 
I had the very same issue: I had added a method called "isDatabase" (returning a BOOL) to the parent entity of my Database entity, which had a relationship named "database". Renaming "isDatabase" to "isOfTypeDatabase" fixed the issue. So keep also looking in parent entities!
The objectID and entity selectors are on `NSManagedObject`, not `NSCFNumber` (or `NSNumber`). I wouldn't expect you to call either of these selectors on a `NSNumber` which should be a property on an entity, not the entity itself.

Every entity in CoreData must extend `NSManagedObject`, so your `NSCFNumber` object is not an entity.