<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFPreferencesCopyAppValue(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFPreferencesCopyAppValue"
  },
  "title" : "CFPreferencesCopyAppValue(_:_:)"
}
-->

# CFPreferencesCopyAppValue(_:_:)

Obtains a preference value for the specified key and application.

```
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 [`kCFPreferencesCurrentApplication`](/documentation/CoreFoundation/kCFPreferencesCurrentApplication). Do not pass `NULL` or [`kCFPreferencesAnyApplication`](/documentation/CoreFoundation/kCFPreferencesAnyApplication). Takes the form of a Java package name, `com.foosoft`.

## Return Value

The preference data for the specified key and application. If no value was located, returns `NULL`. Ownership follows the [The Create Rule](https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html#//apple_ref/doc/uid/20001148-103029).

## Discussion

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)