objective c for iOS: where to store pin code locally

bundle, documents, nsuserdefaults, objective-c, store

Solution

You should definitely store sensitive data in the Keychain. NSUserDefaults stores its data in a plain text file that anyone can read with access to the filesystem.

There are a few open-source classes that ease the use of the Keychain API, you should definitely check them out:

SFHFKeychain access:

SFHFKeychain

Problem

I am making an app that asks the user to enter a pin before they can use the app. My question is: where exactly is it appropriate to store such data (so it can be checked if its correct), NSUserDefaults?, a bundled file ?, apps documents folder ?

Original source