---
title: "CFPreferencesGetAppIntegerValue(_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfpreferencesgetappintegervalue(_:_:_:)"
---

# CFPreferencesGetAppIntegerValue(_:_:_:)

Convenience function that directly obtains an integer preference value for the specified key.

## Declaration

```swift
func CFPreferencesGetAppIntegerValue(_ key: CFString, _ applicationID: CFString, _ keyExistsAndHasValidFormat: UnsafeMutablePointer<DarwinBoolean>?) -> CFIndex
```

## Parameters

- `key`: The preference key whose value you wish to obtain. The key must specify a preference whose value is of type int.
- `applicationID`: The identifier of the application whose preferences you wish 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.
- `keyExistsAndHasValidFormat`: On return, indicates whether the preference value for the specified key was located and found to be of type int.

## Return Value

Return Value The preference data for the specified key and application. If no value was located, 0 is returned.

## See Also

### Getting Preference Values

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