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


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



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.


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


The name of the property you wish to load. Pass one of the provided string constants indicating the property. See File URL Properties and HTTP URL Properties for the list of available properties.


On return, 0 if successful, otherwise an error code indicating the nature of the problem. See 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.


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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software