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

# CFPreferencesCopyMultiple(_:_:_:_:)

Returns a dictionary containing preference values for multiple keys.

```
func CFPreferencesCopyMultiple(_ keysToFetch: CFArray?, _ applicationID: CFString, _ userName: CFString, _ hostName: CFString) -> CFDictionary
```

## Parameters

`keysToFetch`

An array of preference keys the values of which to obtain.

`applicationID`

The ID of the application whose preferences are searched. Takes the form of a Java package name, such as `com.foosoft`.

`userName`

[`kCFPreferencesCurrentUser`](/documentation/CoreFoundation/kCFPreferencesCurrentUser) to search the current-user domain, otherwise [`kCFPreferencesAnyUser`](/documentation/CoreFoundation/kCFPreferencesAnyUser) to search the any-user domain.

`hostName`

[`kCFPreferencesCurrentHost`](/documentation/CoreFoundation/kCFPreferencesCurrentHost) to search the current-host domain, otherwise [`kCFPreferencesAnyHost`](/documentation/CoreFoundation/kCFPreferencesAnyHost) to search the any-host domain.

## Return Value

A dictionary containing the preference values for the keys specified by `keysToFetch` for the specified domain. If no values were located, returns an empty dictionary. 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)