What would cause persistentStoreForURL: to return nil?
What would cause persistentStoreForURL: to return nil?
- Subject: What would cause persistentStoreForURL: to return nil?
- From: Gideon King <email@hidden>
- Date: Sat, 13 Mar 2010 01:48:01 +1000
I know that the URL is valid and it's readable. I can open the file in my application. I can read it into an NSData with dataWithContentsOfURL:
The purpose of what I am doing is trying to migrate to an XML store to see if that will help me isolate the problem I am having with "save as", which I posted about before.
Here's what I do in my test in my persistent document:
NSPersistentStoreCoordinator *psc = [[self managedObjectContext] persistentStoreCoordinator];
NSURL *oldURL = [NSURL fileURLWithPath:@"/Users/gideon/Development/TestNMDocs/Untitled11.nm5"];
NSURL *newURL = [NSURL fileURLWithPath:@"/Users/gideon/Development/TestNMDocs/Untitled11.xml"];
NSError *error;
NSPersistentStore *myStore = [psc persistentStoreForURL:oldURL];
NSPersistentStore *xmlStore = [psc migratePersistentStore:myStore
toURL:newURL
options:nil
withType:NSXMLStoreType
error:&error];
oldURL is verifiably present, readable and valid, but myStore is always nil.
Any ideas?
Thanks
Gideon_______________________________________________
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