Why the Extension Is "Momd" But Not "Xcdatamodel" When Search the Path for the Model File

Couldn't find '.momd' file

I solved the problem this way (I don't fully understand why it's working though) :

- (NSManagedObjectModel *)managedObjectModel {
if (!_managedObjectModel) {
_managedObjectModel = [NSManagedObjectModel mergedModelFromBundles:nil];
}
return _managedObjectModel;
}

Unable to load momd file in ios 9 iPhone 4 simulator

I was using many .xcdatamodel files some of them get worked with Solution1 & some with solution 2

Solution 1:

  • Delete App from simulator
  • Delete .xcdatamodel from xcode & save it somewhere, & re add it.
  • Quit Xcode, Delete Derived data & Repoen XCODE.

Solution 2:

  • Delete App from simulator

  • Create new .xcdatamodel & copy all contains to new .xcdatamodel file

  • Quit Xcode, Delete Derived data & Repoen XCODE.

Core Data: bundle.main.url Thread 1 fatal error

Looking at the screenshots, I suppose the name of the storage should be: CryptoGO. Try this:

guard let modelURL = Bundle.main.url(forResource: "CryptoGO", withExtension: "momd") else {
fatalError("Unable to Find Data Model")
}

How to Get Path of MOMD File in Core Data

Solved the problem a little while ago by looking at what files were in my resources folder and realizing they are .mom files rather than .momd files. So searching for the resource with the .mom file extension solved my problem.

Compilation failed for data model at path - xcode 6

Not sure if you ever resolved this issue, but I had the same issue after I erroneously versioned my data model. I found the steps below fixed my issue:

In Xcode locate your .xcdatamodeld file then click "Show in Finder" and delete the .xcdatamodel file that was not previously visible in Xcode or that was erroneously versioned.

Hope this helps you in some way, if you are still looking for answers.



Related Topics



Leave a reply



Submit