0

I have a requirement that no data can be saved to the device (iPad app). Can I still use Core Data as long as I don't call save()?

Or can I just delete the context when the application closes thereby preventing any data to remain on the device?

Also, will using Magical Record (MR) make a difference? If so, would you suggest Realm or MR for this type of constraint?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
devjme
  • 684
  • 6
  • 12
  • A note regarding *can I just delete the context as the application is closed*: What happens if your app crashes, the device crashes or something unexpected as that? That would leave the file still there. If you don't want to save the data on the device, do not save it, not intermediary, not temporary - dont save it at all. – luk2302 Dec 30 '15 at 20:58
  • 2
    The basic purpose of CoreData is to make objects persistent. If you don't want them to persist, what benefit do you expect from CoreData? – Phillip Mills Dec 30 '15 at 20:59
  • But by "not saving it" does that mean I can't load it into core data objects? – devjme Dec 30 '15 at 20:59
  • I like the model functionality that Core Data provides – devjme Dec 30 '15 at 21:00
  • 3
    OK...there is such a thing as an in-memory data store for Core Data. It might be worth investigating if you want to go that way. – Phillip Mills Dec 30 '15 at 21:05

1 Answers1

0

You can use a in-memory store. That way use you use Core Data graph management. I'd strongly recommend against using Magical Record -- it's design conflicts with the core design of Core Data.

Daniel Eggert
  • 6,665
  • 2
  • 25
  • 41