• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Core data model configuration & Leopard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core data model configuration & Leopard


  • Subject: Core data model configuration & Leopard
  • From: email@hidden
  • Date: Sun, 28 Oct 2007 17:45:26 -0700

I have a relatively simple core data non-document application that runs fine under OS 10.4. However, when I run the same app on OS 10.5, it cannot open the data file. I get the error "The model configuration used to open the store is incompatible with the one that was used to create the store." I traced the first time this was called to the code below, the call to addPersistentStoreWithType. The method "managedObjectContext" has not changed since I created the project with Xcode. Does anyone have any suggestions as what I can do to get my app to read the store in OS 10.5?

Thanks,
Kyle



- (NSManagedObjectContext *) managedObjectContext {
NSError *error;
NSString *applicationSupportFolder = nil;
NSURL *url;
NSFileManager *fileManager;
NSPersistentStoreCoordinator *coordinator;

if (managedObjectContext) {
return managedObjectContext;
}

fileManager = [NSFileManager defaultManager];
applicationSupportFolder = [self applicationSupportFolder];
if ( ![fileManager fileExistsAtPath:applicationSupportFolder isDirectory:NULL] ) {
[fileManager createDirectoryAtPath:applicationSupportFolder attributes:nil];
}

url = [NSURL fileURLWithPath: [applicationSupportFolder stringByAppendingPathComponent: @"MyData.sqlite"]];
coordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel: [self managedObjectModel]];
-> if ([coordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:url options:nil error:&error]){
managedObjectContext = [[NSManagedObjectContext alloc] init];
[managedObjectContext setPersistentStoreCoordinator: coordinator];
} else {
[[NSApplication sharedApplication] presentError:error];
}
[coordinator release];

return managedObjectContext;
}


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Core data model configuration & Leopard
      • From: Chris Hanson <email@hidden>
    • Re: Core data model configuration & Leopard
      • From: mmalc crawford <email@hidden>
  • Prev by Date: Re: XCode 3 SCM not working (CVS and SVN)
  • Next by Date: My Xcode Project Won't Compile 32-Bit
  • Previous by thread: Re: XCode 3 SCM not working (CVS and SVN)
  • Next by thread: Re: Core data model configuration & Leopard
  • Index(es):
    • Date
    • Thread