1

I am storing data with NSKeyedArchiver. When a user logs out of my app, I would like to clear all the data that I have stored. How can I go about doing that? It doesn't appear that [NSKeyedUnarchiver unarchiveObjectWithFile:] removes the file.

Thanks!

lavoy
  • 1,876
  • 3
  • 21
  • 36

1 Answers1

4

NSKeyedArchiver & NSKeyedUnarchiver only encode and decode your objects so they can be stored and retreived. If you are storing the data in a file, just delete the file (use NSFileManager). If you are storing data in other places (eg NSUserDefaults, a database, etc) then you need to delete the data as appropriate for the store.

XJones
  • 21,959
  • 10
  • 67
  • 82