Return a collection of resource values identified by the given resource keys.
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Xcode 7.1+
This method first checks if the URL object already caches the resource value. If so, it returns the cached resource value to the caller. If not, then this method synchronously obtains the resource value from the backing store, adds the resource value to the URL object’s cache, and returns the resource value to the caller. The type of the resource value varies by resource property (see resource key definitions). If this method does not throw and the resulting value in the
URLResource is populated with nil, it means the resource property is not available for the specified resource and no errors occurred when determining the resource property was not available. This method is currently applicable only to URLs for file system resources.
When this function is used from the main thread, resource values cached by the URL (except those added as temporary properties) are removed the next time the main thread’s run loop runs.
func remove and
func remove also may be used to remove cached resource values.
Only the values for the keys specified in
keys will be populated.