0

I've developed a feature for an app that stores it's information in a CoreData object. This data persists when I shut down the app, but not when a user logs out and logs back in. I need the data to persist. Some notes:

1) Some of the other data for the app is uploaded to a server. This is not an option.

2) I cannot for the life of me find how any of the app's other local data is persisted when a user logs out.

3) My boss suggested NSUserDefaults - what would be the best way to save a CoreData object in there?

Thanks in advance for your answers!

1 Answers1

1

CoreData has no concept of a user being logged in our out within your app. The only logical explanation for your CoreData db not persisting is that your application is deleting the data (or the database) when a user logout event is occurring.

CSmith
  • 13,318
  • 3
  • 39
  • 42
  • Thanks for your response. It's possible that it wipes the whole managed object context - I can't mess with the rest of the app's code so any idea how I'd get around this? – Mark Khosla Aug 17 '12 at 12:55