---
title: "CFURLCreatePropertyFromResource(_:_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfurlcreatepropertyfromresource(_:_:_:_:)"
---

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

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

## Declaration

```swift
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 doc://com.apple.corefoundation/documentation/CoreFoundation/file-url-properties and doc://com.apple.corefoundation/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 doc://com.apple.corefoundation/documentation/CoreFoundation/CFURLError for a list of possible error codes.

## Return Value

Return Value If successful, the requested property as a CFType object, NULL otherwise. Ownership follows the The Create Rule.

## Discussion

Discussion This is a convenience function for retrieving individual property values which calls through to CFURLCreateDataAndPropertiesFromResource(_:_:_:_:_:_:).

## See Also

### Core Foundation URL Access Utilities Miscellaneous Functions

- [CFURLCreateDataAndPropertiesFromResource(_:_:_:_:_:_:)](corefoundation/cfurlcreatedataandpropertiesfromresource(_:_:_:_:_:_:).md)
- [CFURLDestroyResource(_:_:)](corefoundation/cfurldestroyresource(_:_:).md)
- [CFURLWriteDataAndPropertiesToResource(_:_:_:_:)](corefoundation/cfurlwritedataandpropertiestoresource(_:_:_:_:).md)
