Loads the data and properties referred to by a given URL.


func CFURLCreateDataAndPropertiesFromResource(_ alloc: CFAllocator!, _ url: CFURL!, _ resourceData: UnsafeMutablePointer<Unmanaged<CFData>?>!, _ properties: UnsafeMutablePointer<Unmanaged<CFDictionary>?>!, _ desiredProperties: CFArray!, _ errorCode: UnsafeMutablePointer<Int32>!) -> Bool



The allocator to use to allocate memory for the new CFData and CFDictionary objects returned in resourceData and properties. Pass NULL or kCFAllocatorDefault to use the current default allocator.


The URL referring to the data and/or properties you wish to load.


On return, contains a CFData object containing the data referred to by url. Ownership follows the The Create Rule.


On return, a pointer to a CFDictionary object containing the resource properties referred to by url. Ownership follows the The Create Rule.


A list of the properties you wish to obtain and return in properties. See File URL Properties and HTTP URL Properties for the list of available properties.


0 if successful, otherwise an error code indicating the nature of the problem. See CFURLError for a list of possible error codes.

Return Value

true if successful, false otherwise.


If you are interested in loading only the resource data or the resource's properties, pass NULL for the one you don't want. If properties is non-NULL and desiredProperties is NULL then all properties are fetched. Note that as much work as possible is done even if false is returned. For instance, if one property is not available, the others are fetched anyway. This function is intended for convenience, not performance.

See Also

Core Foundation URL Access Utilities Miscellaneous Functions