> For the complete documentation index, see [llms.txt](https://ajin-1.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ajin-1.gitbook.io/documentation/mobile/ios/dvia-ti/local-data-storage/userdefaults.md).

# UserDefaults

## Definition

## NSUserDefaults class

The `NSUserDefaults` class provides a programmatic interface for interacting with the defaults system. The defaults system allows an app to customize its behavior to match a user’s preferences. For example, you can allow users to specify their preferred units of measurement or media playback speed. Apps store these preferences by assigning values to a set of parameters in a user’s defaults database. The parameters are referred to as *defaults* because they’re commonly used to determine an app’s default state at startup or the way it acts by default.

At runtime, you use `NSUserDefaults` objects to read the defaults that your app uses from a user’s defaults database. `NSUserDefaults` caches the information to avoid having to open the user’s defaults database each time you need a default value. When you set a default value, it’s changed synchronously within your process, and asynchronously to persistent storage and other processes.

## Chemin d'accès au fichier

```
/var/mobile/Containers/Data/Application/app_name/Library//Preferences 
```

## Pourquoi consulter ce fichier

As per the Apple documentation, NSUserDefaults is used for customization as per the user's preferences. Many times, the developer uses the NSUderDefaults format to store sensitive information.

## Solution

<figure><img src="https://1236449586-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnLNcn403FNHCLyLwYmTO%2Fuploads%2F5VvtZTBmfLbTdPgfdQ3x%2Fimage.png?alt=media&amp;token=7ff02811-2481-40bf-a275-28e9d03deffd" alt=""><figcaption></figcaption></figure>
