FROM : Scott Guyer
DATE : Mon Mar 31 18:45:56 2008
Hi,
I'm just learning core data and have already stumbled on
something. I created a CD application using the XCode template. I've
created a sqlite3 .db file with data and a matching core data model in
xcode. My code fails here...
url = [NSURL fileURLWithPath: [applicationSupportFolder
stringByAppendingPathComponent: @"my.db"]];
persistentStoreCoordinator = [[NSPersistentStoreCoordinator
alloc] initWithManagedObjectModel: [self managedObjectModel]];
if (![persistentStoreCoordinator
addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:url
options:nil error:&error]){
[[NSApplication sharedApplication] presentError:error];
}
with an error saying that the db file cannot be opened because it is
not in the right format. "The file might be corrupted, truncated, or
in a different format than you expect." That's quite odd to me, since
I can interact with that db file on the command line using sqlite3
just fine. Anyone have any ideas/suggestions?
Much appreciated!
DATE : Mon Mar 31 18:45:56 2008
Hi,
I'm just learning core data and have already stumbled on
something. I created a CD application using the XCode template. I've
created a sqlite3 .db file with data and a matching core data model in
xcode. My code fails here...
url = [NSURL fileURLWithPath: [applicationSupportFolder
stringByAppendingPathComponent: @"my.db"]];
persistentStoreCoordinator = [[NSPersistentStoreCoordinator
alloc] initWithManagedObjectModel: [self managedObjectModel]];
if (![persistentStoreCoordinator
addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:url
options:nil error:&error]){
[[NSApplication sharedApplication] presentError:error];
}
with an error saying that the db file cannot be opened because it is
not in the right format. "The file might be corrupted, truncated, or
in a different format than you expect." That's quite odd to me, since
I can interact with that db file on the command line using sqlite3
just fine. Anyone have any ideas/suggestions?
Much appreciated!
| Related mails | Author | Date |
|---|---|---|
| Scott Guyer | Mar 31, 18:45 | |
| Jeff LaMarche | Mar 31, 18:51 | |
| Scott Guyer | Mar 31, 19:23 | |
| Adam Swift | Apr 2, 02:07 |






Cocoa mail archive

