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

# CFURLCreatePropertyFromResource(_:_:_:_:)

Returns a given property specified by a given URL and property string.

```
func CFURLCreatePropertyFromResource(_ alloc: CFAllocator!, _ url: CFURL!, _ property: CFString!, _ errorCode: UnsafeMutablePointer<Int32>!) -> CFTypeRef!
```

## Parameters

`alloc`

The allocator to use to to allocate memory for the new `CFType` object for the requested property. Pass `NULL` or kCFAllocatorDefault to use the current default allocator.

`url`

The `CFURL` object referring to the resource whose properties are loaded.

`property`

The name of the property you wish to load. Pass one of the provided string constants indicating the property. See [File URL Properties](/documentation/CoreFoundation/file-url-properties) and [HTTP URL Properties](/documentation/CoreFoundation/http-url-properties) for the list of available properties.

`errorCode`

On return, `0` if successful, otherwise an error code indicating the nature of the problem. See [`CFURLError`](/documentation/CoreFoundation/CFURLError) for a list of possible error codes.

## Return Value

If successful, the requested property as a `CFType` object, `NULL` otherwise. 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

This is a convenience function for retrieving individual property values which calls through to [`CFURLCreateDataAndPropertiesFromResource(_:_:_:_:_:_:)`](/documentation/CoreFoundation/CFURLCreateDataAndPropertiesFromResource(_:_:_:_:_:_:)).

---

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)