Is a Persistent Store a requirement for Core Data on the iPhone? -
I'm looking to use core data inside my iPhone app.
The app is not really required to store the data used, but it needs to be managed and queryed.
Can core data be used for dataset which is purely in memory and not persisted on disk?
Absolutely, just set the store type to NSInMemoryStoreType More specifically, you set it this way Are:
NSError * error = zero; // Ignore that it is called "NSPersistentStore", it is in NSPersistentStore * MemoryStore = [persistentStoreCoorindator addPersistentStoreWithType: NSInMemoryStoreType Configuration: Zero URL: Zero Option: Zero Error: & amp; Error]; If (inMemoryStore & amp;! Error) {// it is setup}
Comments
Post a Comment