Creates a URL cache object with the specified memory and disk capacities, in the specified directory.
SDKs
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
Framework
- Foundation
Declaration
- (instancetype)initWithMemoryCapacity:(NSUInteger)memoryCapacity diskCapacity:(NSUInteger)diskCapacity directoryURL:(NSURL *)directoryURL;
Parameters
memoryCapacity
The memory capacity of the cache, in bytes.
diskCapacity
The disk capacity of the cache, in bytes.
directoryURL
The path to an on-disk directory at which to store the on-disk cache. If
directory
isnil
, the cache uses a default directory.
Discussion
A disk cache measured in the tens of megabytes should be acceptable in most cases.