<!--
{
  "availability" : [
    "macOS: 10.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SystemConfiguration",
  "identifier" : "/documentation/SystemConfiguration/SCPreferencesGetValue(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "System Configuration"
    ],
    "preciseIdentifier" : "c:@F@SCPreferencesGetValue"
  },
  "title" : "SCPreferencesGetValue(_:_:)"
}
-->

# SCPreferencesGetValue(_:_:)

Retrieves the value associated with the specified preference key.

```
func SCPreferencesGetValue(_ prefs: SCPreferences, _ key: CFString) -> CFPropertyList?
```

## Parameters

`prefs`

The preferences session.

`key`

The preference key.

## Return Value

The value associated with the specified preference key (can be `NULL` if no value exists).

## Discussion

To avoid inadvertantly reading stale data, first call [`SCPreferencesLock(_:_:)`](/documentation/SystemConfiguration/SCPreferencesLock(_:_:)) before calling this function.

---

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)