---
title: "CFPreferencesCopyAppValue(_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfpreferencescopyappvalue(_:_:)"
---

# CFPreferencesCopyAppValue(_:_:)

Obtains a preference value for the specified key and application.

## Declaration

```swift
func CFPreferencesCopyAppValue(_ key: CFString, _ applicationID: CFString) -> CFPropertyList?
```

## Parameters

- `key`: The preference key whose value to obtain.
- `applicationID`: The identifier of the application whose preferences to search, typically doc://com.apple.corefoundation/documentation/CoreFoundation/kCFPreferencesCurrentApplication. Do not pass NULL or doc://com.apple.corefoundation/documentation/CoreFoundation/kCFPreferencesAnyApplication. Takes the form of a Java package name, com.foosoft.

## Return Value

Return Value The preference data for the specified key and application. If no value was located, returns NULL. Ownership follows the The Create Rule.

## Discussion

Discussion Note that values returned from this function are immutable, even if you have recently set the value using a mutable object.

## See Also

### Getting Preference Values

- [CFPreferencesCopyKeyList(_:_:_:)](corefoundation/cfpreferencescopykeylist(_:_:_:).md)
- [CFPreferencesCopyMultiple(_:_:_:_:)](corefoundation/cfpreferencescopymultiple(_:_:_:_:).md)
- [CFPreferencesCopyValue(_:_:_:_:)](corefoundation/cfpreferencescopyvalue(_:_:_:_:).md)
- [CFPreferencesGetAppBooleanValue(_:_:_:)](corefoundation/cfpreferencesgetappbooleanvalue(_:_:_:).md)
- [CFPreferencesGetAppIntegerValue(_:_:_:)](corefoundation/cfpreferencesgetappintegervalue(_:_:_:).md)
