• 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
Re: CoreData, reset a persistent store
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: CoreData, reset a persistent store
      • From: Elise van Looij <email@hidden>
References: 
 >CoreData, reset a persistent store (From: Pierre Chatelier <email@hidden>)
 >Re: CoreData, reset a persistent store (From: Elise van Looij <email@hidden>)

  • Prev by Date: Re: CoreData, reset a persistent store
  • Next by Date: Re: CFRunLookFindMode crash
  • Previous by thread: Re: CoreData, reset a persistent store
  • Next by thread: Re: CoreData, reset a persistent store
  • Index(es):
    • Date
    • Thread