Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Core data: Unable to load class named "CDAccount"

I've recently downloaded iOS 8 to make sure that my existing app works properly with it, but I'm getting a warning in the debugger on launch:

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

After some research, it seems like people have had similar issues when using Core Data in Swift, but all my code is in Objective-C (and the data model hasn't changed for at least 6 months).

Any advice is much appreciated, I'm really nervous that my app isn't going to function properly once people start upgrading to iOS 8!

like image 474
Mason Avatar asked Sep 13 '14 02:09

Mason


3 Answers

I had the exact same problem in Objective-C and Xcode 6. For some reason, Xcode had removed my 'CustomNSManagedObject'.m classes from my Compile Sources.

Go to your project target -> Build Phases -> Compile Sources and use the + button to add CDAccount.m

If you are using Mogenerator to create a _CDAccount.m file, add that to your Compile Sources as well.

like image 131
Dylan Moore Avatar answered Nov 09 '22 22:11

Dylan Moore


Remove the "dot" in Configurations "Default" on .xcdatamodeld:

enter image description here

to:
enter image description here
enter image description here
Rebuild the application.

like image 7
Claudio Guirunas Avatar answered Nov 09 '22 22:11

Claudio Guirunas


My issue was also similar, but the reason was that module of entity was not set.

module selection in Entity properties menu

like image 4
gwyhyr Avatar answered Nov 09 '22 22:11

gwyhyr