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

# CFURLSetTemporaryResourcePropertyForKey(_:_:_:)

Sets a temporary resource value on the URL.

```
func CFURLSetTemporaryResourcePropertyForKey(_ url: CFURL!, _ key: CFString!, _ propertyValue: CFTypeRef!)
```

## Parameters

`url`

The URL.

`key`

The key where the value should be stored. This key must be unique and must not conflict with any system-defined keys. Reverse-domain-name notation is recommended.

`propertyValue`

The value to store.

## Discussion

Your app can use a temporary resource value to temporarily store a value for an app-defined resource value key in memory without modifying the actual resource that the URL represents. Once set, you can copy the temporary resource value from the URL object just as you would copy system-defined keys—by calling [`CFURLCopyResourcePropertyForKey(_:_:_:_:)`](/documentation/CoreFoundation/CFURLCopyResourcePropertyForKey(_:_:_:_:)) or [`CFURLCopyResourcePropertiesForKeys(_:_:_:)`](/documentation/CoreFoundation/CFURLCopyResourcePropertiesForKeys(_:_:_:)).

Your app can remove a temporary resource value from the URL object by calling [`CFURLClearResourcePropertyCacheForKey(_:_:)`](/documentation/CoreFoundation/CFURLClearResourcePropertyCacheForKey(_:_:)) or [`CFURLClearResourcePropertyCache(_:)`](/documentation/CoreFoundation/CFURLClearResourcePropertyCache(_:)) (to remove all temporary values).

This method is applicable only to URLs for file system resources.

---

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)