---
title: "CFPreferencesCopyMultiple(_:_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfpreferencescopymultiple(_:_:_:_:)"
---

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

Returns a dictionary containing preference values for multiple keys.

## Declaration

```swift
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`: doc://com.apple.corefoundation/documentation/CoreFoundation/kCFPreferencesCurrentUser to search the current-user domain, otherwise doc://com.apple.corefoundation/documentation/CoreFoundation/kCFPreferencesAnyUser to search the any-user domain.
- `hostName`: doc://com.apple.corefoundation/documentation/CoreFoundation/kCFPreferencesCurrentHost to search the current-host domain, otherwise doc://com.apple.corefoundation/documentation/CoreFoundation/kCFPreferencesAnyHost to search the any-host domain.

## Return Value

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.

## 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

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