---
title: "SCPreferencesAddValue(_:_:_:)"
framework: systemconfiguration
role: symbol
role_heading: Function
path: "systemconfiguration/scpreferencesaddvalue(_:_:_:)"
---

# SCPreferencesAddValue(_:_:_:)

Associates the specified value with the specified preference key.

## Declaration

```swift
func SCPreferencesAddValue(_ prefs: SCPreferences, _ key: CFString, _ value: CFPropertyList) -> Bool
```

## Parameters

- `prefs`: The preferences session.
- `key`: The preference key.
- `value`: The value to associate with the preference key.

## Return Value

Return Value true if the value was added; false if the key already exists or if an error occurred.

## Discussion

Discussion To commit these changes to permanent storage, you must call SCPreferencesCommitChanges(_:).

## See Also

### Adding, Getting, and Removing Values

- [SCPreferencesGetValue(_:_:)](systemconfiguration/scpreferencesgetvalue(_:_:).md)
- [SCPreferencesSetValue(_:_:_:)](systemconfiguration/scpreferencessetvalue(_:_:_:).md)
- [SCPreferencesRemoveValue(_:_:)](systemconfiguration/scpreferencesremovevalue(_:_:).md)
