0

My iphone/iOS application has a password protected settings page. When the user creates a password, I save the password in a file in library/cache directory.

My problem is: if the user forgets the password, he/she has to delete the app and reinstall it so the password file will be deleted. Just updating the app won't remove the password file. I want to delete/clear this file when the application is updated? How can I do that?

thanks

T.D
  • 177
  • 2
  • 10

1 Answers1

0

The goal of what you want to accomplish is a bit confusing, but ignoring that: every time the app runs, when it starts up, read the contents of a special file. If the file doesn't exist, or if the contents are != the contents of a special string encoded in your app, then you know that the app has been newly installed or updated, and in that case, delete that password file, and write the 'correct' string to the special file. Every time you issue a new version, change that special string. So, you could use the version number, and write that.

Colin
  • 3,670
  • 1
  • 25
  • 36