Re: CoreData, reset a persistent store
Re: CoreData, reset a persistent store
- Subject: Re: CoreData, reset a persistent store
- From: Pierre Chatelier <email@hidden>
- Date: Tue, 14 Nov 2006 15:37:42 +0100
I am wondering how to reset a persistent store used by a single
data model.
If I understand you correctly, yes. In Xcode, simply change the url
in your appDelegate's (or controllers) .m file:
url = [NSURL fileURLWithPath: [applicationSupportFolder
stringByAppendingPathComponent: @"someProject.xml"]];
( see http://www.cocoadevcentral.com/articles/000085.php on how to
set the correct type).
The build and run will take a bit longer the first time, but that's
all. The store itself you'll find under the theUser/Library/
Application Support/SomeProject/
The NSPersistentStoreCoordinator is designed not to care which
store you use, as long as it confirms to the expecations of the
ManagedObjectContext which in turn looked to the data model for
guidance.
I do not understand... Do you mean that I should replace the
persistent-file, at run-time, by an empty one that could be embedded
in the application resources ?
My problem is that my persistent store contains cached data, and that
sometimes i would like to empty it to avoid infinite growing. And
that not method of NSPersistentCoordinator proposed to empty the files.
Regards,
Pierre Chatelier
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden