Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

moonman239

Cancelled
Original poster
Mar 27, 2009
1,541
32
A while ago, I renamed my Core Data managed object subclasses, but changed them all back, so now the class names match their entity names. However, even after deleting and reinstalling, I get this message for one of my entities:

"CoreData: warning: Unable to load class named 'X' for entity 'Y'. Class not found, using default NSManagedObject instead."

where X is the name I put in and Y is the actual name.

I can't find any mention of the old name in my project. Do I need to delete my model and start over?
 
Last edited:
A while ago, I renamed my Core Data managed object subclasses, but changed them all back, so now the class names match their entity names. However, even after deleting and reinstalling, I get this message for one of my entities:

"CoreData: warning: Unable to load class named 'X' for entity 'Y'.

where X is the name I put in and Y is the actual name.

I can't find any mention of the old name in my project. Do I need to delete my model and start over?
Are you running on Xcode on the sim or personal test device?

If so, I had a problem several times with Core Data and it was solved by deleting the app from sim and/or device. If you FULLY remove the app from your sim/device, it gives it a fresh start.

Give that a quick try and report back.

Edit: just in case you don't know what I'm talking about, open you sim go to your app press-n-hold until it prompts you to delete. It's odd, but it actually fixes a core data problem.
 
Last edited:
Are you running on Xcode on the sim or personal test device?

If so, I had a problem several times with Core Data and it was solved by deleting the app from sim and/or device. If you FULLY remove the app from your sim/device, it gives it a fresh start.

Give that a quick try and report back.

Edit: just in case you don't know what I'm talking about, open you sim go to your app press-n-hold until it prompts you to delete. It's odd, but it actually fixes a core data problem.
iPad. Did that, didn't work.
 
A while ago, I renamed my Core Data managed object subclasses, but changed them all back, so now the class names match their entity names. However, even after deleting and reinstalling, I get this message for one of my entities:

"CoreData: warning: Unable to load class named 'X' for entity 'Y'. Class not found, using default NSManagedObject instead."

where X is the name I put in and Y is the actual name.

I can't find any mention of the old name in my project. Do I need to delete my model and start over?

"Core Data managed object subclasses" << you're talking about the classes that xcode generates for you? So those were renamed then named back and it doesn't work.

the X is new name and Y is the old name?

So somehow the Core Data class info for the old stuff is stuck somewhere. IDK where CD stores all it's config stuff.

It would be interesting to make a new project with CD and search the directory for the name of that class just to see all the places where it's stored. You could then change the name and see where the new name and old name are.

I don't know how to search inside of files in OSX, IDK if finder will do it or not.

My guess is that Xcode/Apple/IOS is storing information in some config file somewhere and if that were deleted it would have to regen (or never work again :D).


What happens if you name it back to the other name?

Have you tried the 'clean' option? It's up in the menu system of Xcode somewhere.

Another option is to make a new project, copy over one by one, all the source files and make a new project, see if that flushes out the old settings.
 
Try regenerating the subclasses in the Editor menu, while in the data-model viewer. Also make sure that none of the entities have any mismatched names in the data-model inspector.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.