Removes all cached resource values and temporary resource values from the URL object.
SDKs
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
func removeAllCachedResourceValues()
Discussion
This method is applicable only to URLs that represent file system resources.
Note
The caching behavior of the NSURL
and CFURL
APIs differ. For NSURL
, all cached values (not temporary values) are automatically removed after each pass through the run loop. You only need to call the remove
method when you want to clear the cache within a single execution of the run loop. The CFURL
functions, on the other hand, do not automatically clear cached resource values. The client has complete control over the cache lifetimes, and you must use CFURLClear
or CFURLClear
to clear cached resource values.