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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:29:04+00:00 2026-05-24T07:29:04+00:00

I have seen this question posted here, but always, the answer is that the

  • 0

I have seen this question posted here, but always, the answer is that the model has been changed, reset the simulator, remove the store.

I am also getting this error, however, this is a new app. I have not added/changed entities nor attributes.

I’ve deleted the store, I’ve reset the simulator, but I get the same results.

Here is the store code.. Is there any other cause for this problem?

- (NSManagedObjectModel *)managedObjectModel {
   //  NSLog(@"%s", __FUNCTION__);
    if (managedObjectModel_ != nil) {
        return managedObjectModel_;
    }

    NSString *modelPath = [[NSBundle mainBundle] pathForResource:@"Lexicon" ofType:@"momd"];
    NSURL *modelURL = [NSURL fileURLWithPath:modelPath];
    managedObjectModel_ = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];    
    return managedObjectModel_;
}

/**
 Returns the persistent store coordinator for the application.
 If the coordinator doesn't already exist, it is created and the application's store added to it.
 */
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator {

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

    NSURL *storeURL = [NSURL fileURLWithPath: [[self applicationDocumentsDirectory] stringByAppendingPathComponent: @"dict.sqlite"]];

    NSError *error = nil;
    persistentStoreCoordinator_ = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];
    if (![persistentStoreCoordinator_ addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) {

        NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
        abort();
    }    

    return persistentStoreCoordinator_;
}

Here is the console spew:

2011-08-03 11:42:38.936 Lexicon[4468:f203] -[AppDelegate
application:didFinishLaunchingWithOptions:] 2011-08-03 11:42:38.989
Lexicon[4468:f203] -[AppDelegate applicationDocumentsDirectory]
2011-08-03 11:42:39.048 Lexicon[4468:f203] Unresolved error Error
Domain=NSCocoaErrorDomain Code=134100 “The operation couldn’t be
completed. (Cocoa error 134100.)” UserInfo=0x6d3ee60
{metadata={type = immutable dict,
count = 7, entries => 2 : {contents =
“NSStoreModelVersionIdentifiers”} = {type = immutable, count = 1, values = ( 0 : {length = 0, capacity = 0, bytes = 0x} )} 4 :
{contents =
“NSPersistenceFrameworkVersion”} = {value = +363, type = kCFNumberSInt64Type} 6 : {contents = “NSStoreModelVersionHashes”} =
{type = immutable dict, count = 1,
entries => 0 : {contents =
“LexiconEntity”} = {length = 32,
capacity = 32, bytes = 0x8698c5295fa5124b78a6b127bba26ff0 …
70eaece0517cd4c6} }

7 : {contents = “NSStoreUUID”} =
{contents =
“86B22D58-28A5-4585-8650-07111B34B43A”} 8 : {contents = “NSStoreType”} = {contents = “SQLite”} 9 : {contents = “_NSAutoVacuumLevel”} = {contents = “2”} 10 : {contents = “NSStoreModelVersionHashesVersion”} =
{value = +3, type =
kCFNumberSInt32Type} } , reason=The model used to open the store is
incompatible with the one used to create the store}, {
metadata = {
NSPersistenceFrameworkVersion = 363;
NSStoreModelVersionHashes = {
LexiconEntity = <8698c529 5fa5124b 78a6b127 bba26ff0
f3bc678b a4f1e809 70eaece0 517cd4c6>;
};
NSStoreModelVersionHashesVersion = 3;
NSStoreModelVersionIdentifiers = (
<>
);
NSStoreType = SQLite;
NSStoreUUID = “86B22D58-28A5-4585-8650-07111B34B43A”;
“_NSAutoVacuumLevel” = 2;
};
reason = “The model used to open the store is incompatible with
the one used to create the store”; }

  • 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-24T07:29:05+00:00Added an answer on May 24, 2026 at 7:29 am

    It turns out that the sqlite DB store was built incorrectly. So, in this case, the message was rather accurate.

    The issue above was real. The database did not reflect the model.

    The solution is to let Core Data create the empty data base from the model, and then have Core Data import the data itself.

    I first exported my sqlite database to sql calling the file db.sql (imaginative!). I only exported the data table and the primary key table, not the metadata table. I used an app called SQLiteManager for this. You can also do it at the command line.

    All the code is stock stuff except for handling the Persistent Store Controller..

    That code is as follows:

    - (NSPersistentStoreCoordinator *)persistentStoreCoordinator {
    
        if (persistentStoreCoordinator_ != nil) {
            return persistentStoreCoordinator_;
        }
    
    
        NSString *storePath = [[self applicationDocumentsDirectory] stringByAppendingPathComponent:@"db.sql"];
    
        // set up the backing store
        NSFileManager *fileManager = [NSFileManager defaultManager];
        // If the expected store doesn't exist, copy the default store.
        if (![fileManager fileExistsAtPath:storePath]) {
            NSString *defaultStorePath = [[NSBundle mainBundle] pathForResource:@"dict" ofType:@"sqlite"];
            if (defaultStorePath) {
                [fileManager copyItemAtPath:defaultStorePath toPath:storePath error:NULL];
            }
        }
    
        NSURL *storeURL = [NSURL fileURLWithPath:storePath];
    
        NSError *error = nil;
        persistentStoreCoordinator_ = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];
        if (![persistentStoreCoordinator_ addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) {
    
            NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
            abort();
        }    
    
        return persistentStoreCoordinator_;
    }
    

    I hope this helps.. It seems to work for me..

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

Sidebar

Related Questions

I've seen that this question has been posted a couple of times but nothing
I've seen this question posted here previously but I'm not satisfied that I understand
This question seems to have been asked a lot, but I haven't seen an
this is a question i've seen here but the solution posted didn't resolve my
I have seen this question a couple of times here in SO but none
Haven't seen many Geneva related questions yet, I have posted this question in the
Now I have seen this question in another forum but it didn't had an
This question may seem a little bit stackoverflow-implementation specific, but I have seen a
This is probably the worst question I have ever posted on Stack Overflow but
I have seen this question posted several times with no useful answers. I am

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.