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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:45:33+00:00 2026-06-05T01:45:33+00:00

Using a book tutorial, the 3 other Persistence methods worked flawlessly. Getting this message

  • 0

Using a book tutorial, the 3 other Persistence methods worked flawlessly. Getting this message when running simulator:

2012-06-01 23:50:52.555 Core Data Persistence[9022:fb03] Unresolved
error Error Domain=NSCocoaErrorDomain Code=134100 “The operation
couldn’t be completed. (Cocoa error 134100.)” UserInfo=0x6b92af0
{metadata={type = immutable dict,
count = 7, entries => 2 : {contents =
“NSStoreModelVersionIdentifiers”} = {type = immutable, count = 1, values = ( 0 : {contents = “”} )} 4 : {contents = “NSPersistenceFrameworkVersion”} = {value = +386, type = kCFNumberSInt64Type} 6 :
{contents =
“NSStoreModelVersionHashes”} = {type = immutable dict, count = 1, entries => 1 :
{contents = “Line”} = {length = 32, capacity = 32, bytes =
0x03913bef8e6d277b9119a99fbc7b4adc … 39db5d5f94ed5507} } 7 :
{contents = “NSStoreUUID”} = {contents =
“FE367DDA-4009-4CD1-9B8A-D62943668E8E”} 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 = 386;
NSStoreModelVersionHashes = {
Line = <03913bef 8e6d277b 9119a99f bc7b4adc 4fec730a 73b61247 39db5d5f 94ed5507>;
};
NSStoreModelVersionHashesVersion = 3;
NSStoreModelVersionIdentifiers = (
“”
);
NSStoreType = SQLite;
NSStoreUUID = “FE367DDA-4009-4CD1-9B8A-D62943668E8E”;
“_NSAutoVacuumLevel” = 2;
};
reason = “The model used to open the store is incompatible with the one used to create the store”; }

Both my entities are set up correctly, here’s my file:

#import "BIDViewController.h"
#import "BIDAppDelegate.h"

@interface BIDViewController ()

@end

@implementation BIDViewController
@synthesize line1;
@synthesize line2;
@synthesize line3;
@synthesize line4;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    BIDAppDelegate *appDelegate = 
    [[UIApplication sharedApplication] delegate];
    NSManagedObjectContext *context = [appDelegate managedObjectContext];
    NSEntityDescription *entityDescription = [NSEntityDescription
                                              entityForName:@"Line"
                                              inManagedObjectContext:context];
    NSFetchRequest *request = [[NSFetchRequest alloc] init];
    [request setEntity:entityDescription];

    NSError *error;
    NSArray *objects = [context executeFetchRequest:request error:&error];
    if (objects == nil) {
        NSLog(@"There was an error!");
        // Do whatever error handling is appropriate
    }

    for (NSManagedObject *oneObject in objects) {
        NSNumber *lineNum = [oneObject valueForKey:@"lineNum"];
        NSString *lineText = [oneObject valueForKey:@"lineText"];

        NSString *fieldName = [NSString
                               stringWithFormat:@"line%d", [lineNum integerValue]];
        UITextField *theField = [self valueForKey:fieldName];
        theField.text = lineText;
    }

UIApplication *app = [UIApplication sharedApplication];
[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(applicationWillResignActive:) 
                                             name:UIApplicationWillResignActiveNotification
                                           object:app];
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
    self.line1 = nil;
    self.line2 = nil;
    self.line3 = nil;
    self.line4 = nil;


}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

-(void)applicationWillResignActive:(NSNotification *) notification {
    BIDAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
    NSManagedObjectContext *context = [appDelegate managedObjectContext];
    NSError *error;
    for (int i = 1; i <=4; i++) {
        NSString *fieldName = [NSString stringWithFormat:@"line%d", i];
        UITextField *theField = [self valueForKey:fieldName];

        NSFetchRequest *request = [[NSFetchRequest alloc] init];

        NSEntityDescription *entityDescription = [NSEntityDescription
                                                  entityForName:@"Line"
                                                  inManagedObjectContext:context];
        [request setEntity:entityDescription];
        NSPredicate *pred = [NSPredicate
                             predicateWithFormat:@"(lineNum = %d)", i];
        [request setPredicate:pred];

        NSManagedObject *theLine = nil;

        NSArray *objects = [context executeFetchRequest:request
                                                  error:&error];

        if (objects == nil) {
            NSLog(@"There was an error!");
            // Do whatever error handling is appropriate
        }

        if ([objects count] > 0)
            theLine = [objects objectAtIndex:0];
        else 
            theLine = [NSEntityDescription
                       insertNewObjectForEntityForName:@"Line"
                       inManagedObjectContext:context];

        [theLine setValue:[NSNumber numberWithInt:i] forKey:@"lineNum"];
        [theLine setValue:theField.text forKey:@"lineText"];
    }
    [context save:&error];
}

@end

Any thoughts or opinions are appreciated!

  • 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-05T01:45:34+00:00Added an answer on June 5, 2026 at 1:45 am

    Guess you changed your core data model, after initially installing your app in the simulator.

    reason=The model used to open the store is incompatible with the one used to create the store

    Did you try deleting and reinstalling the app?

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

Sidebar

Related Questions

I am practicing this RoR tutorial project of Michael Hartl: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book I am using
I have seen this in some book/ tutorial. When you pass in the head
Using the Ruby on Rails tutorial for OSX here: http://ruby.railstutorial.org/book/ruby-on-rails-tutorial It states to install
Does anyone know of a really good tutorial, book or article on debugging using
I am learning ruby from this guide http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#sec:deploying , and I am trying to
The Javascript tutorial I follow always defines before using, but my PHP book always
Hello friends i need a book/ tutorials for rails without using scoffold. All the
I'm using Google Book Search API to add missings bits and pieces to my
I was trying to use the function glMultiDrawElements while studying OpenGL (using red book)
I'm a newb to RoR. I'm using the book Agile Web Development with Rails

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.