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 1090377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:21:54+00:00 2026-05-16T23:21:54+00:00

I have an iPhone app that is using CoreData. I recently made some minor

  • 0

I have an iPhone app that is using CoreData. I recently made some minor changes to the data model and now every time the app is opened I get an error “Can’t find model for source store”.

I have 2 version of the data model and the only changes I’ve made were some additions of some fields. I was following the guide here which worked initially, then just today, after adding some additional fields, it breaks. All additional fields are marked as optional and all have default values. The migration code is below:

NSURL *storeUrl = [NSURL fileURLWithPath:[[self applicationDocumentsDirectory] stringByAppendingPathComponent:@"xxx.sqlite"]];

// migration options
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
                         [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,
                         [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];

NSError *error = nil;
persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];

if (![persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeUrl options:options error:&error]) {
...
}

The managedObjectModel is successfully created here:

- (NSManagedObjectModel *)managedObjectModel {

if (managedObjectModel != nil) {
    return managedObjectModel;
}

NSString *path = [[NSBundle mainBundle] pathForResource:@"DataModelName" ofType:@"momd"];
NSURL *momURL = [NSURL fileURLWithPath:path];
managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:momURL];

return managedObjectModel;
}

I’ve tracked down the issue to a mismatch in the version has for 1 entity. The error that gets thrown includes this has for the entity:

MyEntityName = <cc1456b7 b12d0d05 21930308 94ccc078 27a6c345 8847c738 e3a9ae7e 0be9535d>;

but the hash in the VersionInfo.plist in the app bundle is:

MyEntityName = <fede6b59 462442d1 8fc98226 b9f8f745 3250dabd ee188248 cb97b1d0 8a74eef3>;

There are no other entities anywhere in the VersionInfo.plist with the hash <cc1456b7....>.

  • 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-05-16T23:21:54+00:00Added an answer on May 16, 2026 at 11:21 pm

    From the linked answer,

    This seems great and as simple as I wanted – but I think you need to be careful during development as you change a model – otherwise you will have to create a new version for each change.

    It sounds like you made version 2, edited version 2, ran the app, edited version 2 again, and ran the app again. This doesn’t work so well; you need to save all the model versions you expect to be able to open. This is a bit of a hassle.

    What you could do is name all your models after app versions, e.g. FooModel-1 and FooModel-1.1 corresponding to releases, and FooModel-1.2d1, FooModel-1.2d2 for “development” versions. Before release, you can rename FooModel-1.2d10 to FooModel-1.2 and remove the other development versions.

    (Or I could be entirely misreading the question; sorry.)

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

Sidebar

Related Questions

I have an iPhone app that stores some settings using NSUserDefault standardUserDefaults . When
I have a Core Data app that will end up being an iPhone/iPad universal
This had been driving me crazy.... I have an iPhone app that is using
I'm using core data on an iPhone application. I have multiple persisntent stores that
I have an iPhone app that hides the status bar. However, my main view
I have an iPhone app that compiles and runs fine in the Simulator on
I have a simple iphone app that's based on the CrashLanding sample app. So
I am using CoreData with iPhone SDK. I am making a notes app. I
I am using Core Data for my iPhone app. My attributes are set with
So I am working on a simple iPhone app, that uses core data to

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.