Up
Authors
- Generated by root
-
- Declared in:
- Foundation/NSURLCache.h
- Conforms to:
- NSCoding
- NSCopying
Availability: MacOS-X 10.2.0, Base 1.13.0
Encapsulates a cached response to a URL load request.
Method summary
- (
NSData*)
data;
Availability: MacOS-X 10.2.0, Base 1.13.0
Returns the data with which the receiver was initialised.
- (id)
initWithResponse: (
NSURLResponse*)response
data: (
NSData*)data;
Availability: MacOS-X 10.2.0, Base 1.13.0
Uses the NSURLCacheStorageAllowed policy to cache the specified response and data .
Returns the cached response.
- (
NSURLResponse*)
response;
Availability: MacOS-X 10.2.0, Base 1.13.0
Returns the response with which the receiver was initialised.
- (
NSURLCacheStoragePolicy)
storagePolicy;
Availability: MacOS-X 10.2.0, Base 1.13.0
Returns the storage policy with which the receiver was initialised.
- (
NSDictionary*)
userInfo;
Availability: MacOS-X 10.2.0, Base 1.13.0
Returns the user info dictionary with which the receiver was initialised (if any).
- Declared in:
- Foundation/NSURLCache.h
Availability: MacOS-X 10.2.0, Base 1.13.0
Description forthcoming.
Method summary
+ (void)
setSharedURLCache: (
NSURLCache*)cache;
Availability: MacOS-X 10.2.0, Base 1.13.0
Sets the shared
NSURLCache
used throughout the process.
If you are going to call this method to specify an alternative to the default
cache, you should do so before the shared
cache is used in order to avoid loss of data that was in the old
cache.
+ (
NSURLCache*)
sharedURLCache;
Availability: MacOS-X 10.2.0, Base 1.13.0
Returns the shared cache instance set by
+setSharedURLCache:
or, if none has been set, returns an instance initialised with
- Memory capacity
-
4 megabytes
- Disk capacity
-
20 megabytes
- Disk path
-
user-library-path/Caches/current-app-name
- (unsigned)
currentDiskUsage;
Availability: MacOS-X 10.2.0, Base 1.13.0
Returns the current size (butes) of the data stored in the on-disk cache.
- (unsigned)
currentMemoryUsage;
Availability: MacOS-X 10.2.0, Base 1.13.0
Returns the current size (butes) of the data stored in the in-memory cache.
- (unsigned)
diskCapacity;
Availability: MacOS-X 10.2.0, Base 1.13.0
Returns the disk capacity (in bytes) of the cache.
- (id)
initWithMemoryCapacity: (unsigned)memoryCapacity
diskCapacity: (unsigned)diskCapacity
diskPath: (
NSString*)path;
Availability: MacOS-X 10.2.0, Base 1.13.0
Returns the receiver initialised with the specified capacities (in bytes) and using the specified location on disk for persistent storage.
- (unsigned)
memoryCapacity;
Availability: MacOS-X 10.2.0, Base 1.13.0
Returns the memory capacity (in bytes) of the cache.
- (void)
removeAllCachedResponses;
Availability: MacOS-X 10.2.0, Base 1.13.0
Empties the cache.
- (void)
removeCachedResponseForRequest: (
NSURLRequest*)request;
Availability: MacOS-X 10.2.0, Base 1.13.0
Removes from the cache (if present) the
NSCachedURLResponse
which was stored using the specified
request.
- (void)
setDiskCapacity: (unsigned)diskCapacity;
Availability: MacOS-X 10.2.0, Base 1.13.0
Sets the disk capacity (in bytes) truncating cache contents if necessary.
- (void)
setMemoryCapacity: (unsigned)memoryCapacity;
Availability: MacOS-X 10.2.0, Base 1.13.0
Sets the memory capacity (in bytes) truncating cache contents if necessary.
- (void)
storeCachedResponse: (
NSCachedURLResponse*)cachedResponse
forRequest: (
NSURLRequest*)request;
Availability: MacOS-X 10.2.0, Base 1.13.0
Stores cachedResponse in the cache, keyed on request.
Replaces any existing response with the same key.
Up