jdog
jdog

Reputation: 10769

How can I fix "Failed to load model named datamodelname" in xcode

I decided to rename my Xcode Project. I then renamed my .xcdatamodeld file. I went into the Utilities and set Codegen to Manual and then went to Editor - Create NSManagedOb.. and it generated the two cored data entity files.

Now when I compile and run I get a SIGABRT crash with the error

"Failed to load model named Warehouse
CoreData: error:  Failed to load model named Warehouse"

Not sure how to fix this?

Upvotes: 0

Views: 2328

Answers (1)

Tom Harrington
Tom Harrington

Reputation: 70976

Somewhere in your app you have code that tries to load a model named Warehouse, which is probably the old project name. You need to find that code and change it to use the new name.

Depending on how old your Core Data code is, this might be when you create an NSPersistentContainer. Or it might be when you create an NSManagedObjectModel.

Upvotes: 3

Related Questions