• 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: Elise van Looij <email@hidden>
  • Date: Tue, 14 Nov 2006 15:29:11 +0100

Op 14-nov-2006, om 14:43 heeft Pierre Chatelier het volgende geschreven:

Hello,

I am wondering how to reset a persistent store used by a single data model.
-A simple solution would be to fetch all objects and delete them; this consumes much memory.
-I am not sure that deleting the file under the persistent store is a good idea.
-the "reset" method of the managed object model is not designed for that.


Did I miss something ?

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.


Elise van Looij


_______________________________________________ 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: Pierre Chatelier <email@hidden>
References: 
 >CoreData, reset a persistent store (From: Pierre Chatelier <email@hidden>)

  • Prev by Date: Core Data PersistentStore woes with SQLite
  • Next by Date: Re: CoreData, reset a persistent store
  • Previous by thread: CoreData, reset a persistent store
  • Next by thread: Re: CoreData, reset a persistent store
  • Index(es):
    • Date
    • Thread