<!--
{
  "documentType" : "article",
  "framework" : "SystemConfiguration",
  "identifier" : "/documentation/SystemConfiguration/scdynamicstore-gb2",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "SCDynamicStore"
}
-->

# SCDynamicStore

## Overview

The `SCDynamicStore` programming interface provides access to the key-value pairs in the dynamic store of a running system. The dynamic store contains, among other items, a copy of the configuration settings for the currently active set (which is sometimes refered to as the location) and information about the current network state.

The functions in the `SCDynamicStore` programming interface allow you to find key-value pairs, add or remove key-value pairs, add or change values, and request notifications. Note that these functions follow Core Foundation function-name conventions. A function that has “Create” or “Copy” in its name returns a reference you must release with the <doc://com.apple.documentation/documentation/CoreFoundation/CFRelease> function.

To use these functions, you must first establish a dynamic store session using the [`SCDynamicStoreCreate(_:_:_:_:)`](/documentation/SystemConfiguration/SCDynamicStoreCreate(_:_:_:_:)) function. When you are finished with the session, use `CFRelease` to close it.

## Topics

### Creating a Dynamic Store Session

[`func SCDynamicStoreCreateWithOptions(CFAllocator?, CFString, CFDictionary?, SCDynamicStoreCallBack?, UnsafeMutablePointer<SCDynamicStoreContext>?) -> SCDynamicStore?`](/documentation/SystemConfiguration/SCDynamicStoreCreateWithOptions(_:_:_:_:_:))

Creates a new session used to interact with the dynamic store maintained by the System Configuration server.

[`func SCDynamicStoreCreate(CFAllocator?, CFString, SCDynamicStoreCallBack?, UnsafeMutablePointer<SCDynamicStoreContext>?) -> SCDynamicStore?`](/documentation/SystemConfiguration/SCDynamicStoreCreate(_:_:_:_:))

Creates a new session used to interact with the dynamic store maintained by the System Configuration server.

### Adding or Updating Keys and Values

[`func SCDynamicStoreAddTemporaryValue(SCDynamicStore, CFString, CFPropertyList) -> Bool`](/documentation/SystemConfiguration/SCDynamicStoreAddTemporaryValue(_:_:_:))

Temporarily adds the specified key-value pair to the dynamic store, if no such key already exists.

[`func SCDynamicStoreAddValue(SCDynamicStore?, CFString, CFPropertyList) -> Bool`](/documentation/SystemConfiguration/SCDynamicStoreAddValue(_:_:_:))

Adds the specified key-value pair to the dynamic store, if no such key already exists.

[`func SCDynamicStoreSetMultiple(SCDynamicStore?, CFDictionary?, CFArray?, CFArray?) -> Bool`](/documentation/SystemConfiguration/SCDynamicStoreSetMultiple(_:_:_:_:))

Updates multiple values in the dynamic store.

[`func SCDynamicStoreSetValue(SCDynamicStore?, CFString, CFPropertyList) -> Bool`](/documentation/SystemConfiguration/SCDynamicStoreSetValue(_:_:_:))

Adds or replaces a value in the dynamic store for the specified key.

### Getting Keys and Values

[`func SCDynamicStoreCopyKeyList(SCDynamicStore?, CFString) -> CFArray?`](/documentation/SystemConfiguration/SCDynamicStoreCopyKeyList(_:_:))

Returns the keys that represent the current dynamic store entries that match the specified pattern.

[`func SCDynamicStoreCopyMultiple(SCDynamicStore?, CFArray?, CFArray?) -> CFDictionary?`](/documentation/SystemConfiguration/SCDynamicStoreCopyMultiple(_:_:_:))

Returns the key-value pairs that match the specified keys and key patterns.

[`func SCDynamicStoreCopyNotifiedKeys(SCDynamicStore) -> CFArray?`](/documentation/SystemConfiguration/SCDynamicStoreCopyNotifiedKeys(_:))

Returns the keys that have changed since the last call to this function.

[`func SCDynamicStoreCopyValue(SCDynamicStore?, CFString) -> CFPropertyList?`](/documentation/SystemConfiguration/SCDynamicStoreCopyValue(_:_:))

Returns the value associated with the specified key.

### Monitoring Keys and Values

[`func SCDynamicStoreNotifyValue(SCDynamicStore?, CFString) -> Bool`](/documentation/SystemConfiguration/SCDynamicStoreNotifyValue(_:_:))

Causes a notification to be delivered for the specified key in the dynamic store.

[`func SCDynamicStoreSetNotificationKeys(SCDynamicStore, CFArray?, CFArray?) -> Bool`](/documentation/SystemConfiguration/SCDynamicStoreSetNotificationKeys(_:_:_:))

Specifies a set of keys and key patterns that should be monitored for changes.

[`func SCDynamicStoreSetDispatchQueue(SCDynamicStore, dispatch_queue_t?) -> Bool`](/documentation/SystemConfiguration/SCDynamicStoreSetDispatchQueue(_:_:))

Initiates notifications for the notification keys, using the specified dispatch queue for the callback.

### Removing Keys and Values

[`func SCDynamicStoreRemoveValue(SCDynamicStore?, CFString) -> Bool`](/documentation/SystemConfiguration/SCDynamicStoreRemoveValue(_:_:))

Removes the value of the specified key from the dynamic store.

### Creating a Run Loop Source

[`func SCDynamicStoreCreateRunLoopSource(CFAllocator?, SCDynamicStore, CFIndex) -> CFRunLoopSource?`](/documentation/SystemConfiguration/SCDynamicStoreCreateRunLoopSource(_:_:_:))

Creates a run loop source object that can be added to the application’s run loop.

### Getting Information About the Dynamic Store

[`func SCDynamicStoreGetTypeID() -> CFTypeID`](/documentation/SystemConfiguration/SCDynamicStoreGetTypeID())

Returns the type identifier of all `SCDynamicStore` instances.

### Data Types

[`typealias SCDynamicStoreCallBack`](/documentation/SystemConfiguration/SCDynamicStoreCallBack)

Callback used when notification of changes made to the dynamic store is delivered.

[`struct SCDynamicStoreContext`](/documentation/SystemConfiguration/SCDynamicStoreContext)

Structure containing user-specified data and callbacks for a dynamic store session.

[`class SCDynamicStore`](/documentation/SystemConfiguration/SCDynamicStore)

The handle to an open dynamic store session with the system configuration daemon.

### Constants

[Dynamic Store Options Keys](/documentation/SystemConfiguration/dynamic-store-options-keys)

Keys that indicate the options for a dynamic store session.



---

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)