Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8619893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:27:00+00:00 2026-06-12T06:27:00+00:00

I’m receiving an ‘Cannot create an NSPersistentStoreCoordinator with a nil model’ error after deleting

  • 0

I’m receiving an 'Cannot create an NSPersistentStoreCoordinator with a nil model' error after deleting my application from device. I’m testing an iPhone app in an iPad device. I’ve put this code to check if I have the file in AppDelegate.m:

- (NSManagedObjectModel *)managedObjectModel {
    if (__managedObjectModel != nil) {
        return __managedObjectModel;
    }
    NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"Name" withExtension:@"momd"];
    if ([[NSFileManager defaultManager] fileExistsAtPath:[modelURL path]]) {
        NSLog(@"%@", [modelURL path]); //This is printed because file exists
    }
    __managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
    return __managedObjectModel;
}

The problem is that [NSManagedObjectModel initWithContentsOfURL] is returning nil value.
I’ve done the following things, with no success:

  1. Change managedObjectModel instantiation with this __managedObjectModel = [NSManagedObjectModel mergedModelFromBundles:nil];
  2. Cleaned Build Folder and Cleaned project
  3. Restarted Xcode
  4. Restarted computer
  5. Changed “momd” to “mom”
  6. .xcdatamodeld is in Copy Bundle Resources and Compile Sources
  7. Renamed .xcdatamodeld and cleaned and closed Xcode project several times
  8. Turned off and on the device
  9. Deleted folders from: $ cd /Users/john/Library/Developer/Xcode/DerivedData
  10. Changed sqlite name for forcing database generation
  11. Deleted (again) application from devine

I’ve been searching the solution for hours, and I still cannot find it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:27:01+00:00Added an answer on June 12, 2026 at 6:27 am

    Finally, after two days trying to solve this issue, I’ve found the solution here:

    How to create the magic .xcdatamodeld folder / package?

    I’m now finishing a project that other developer started, and it seems that he didn’t pushed the latest changes to the repo, but those changes were in the app in the device, and when I removed the app I deleted the right .xcdatamodeld file. The problem was that I had just a MyApp.xcdatamodel file in the project, and this was the reason of having a momd empty folder, it seems.

    In order to create the right hierarchy of data model, the solution was quite easy:

    1. Select the MyApp.xcdatamodel
    2. Go to Editor > Add Model Version…

    And this embedded the MyApp.xcdatamodel file into MyApp.xcdatamodeld. Now the momd folder has the mom files and the app runs OK. The only problem now is that I have two MyApp.xcdatamodel, one with a green selected icon, but both with the same content so no problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.