Instance Method

resourceDataUsingCache:

Returns the receiver’s resource data, loading it if necessary.

Declaration

- (NSData *)resourceDataUsingCache:(BOOL)shouldUseCache;

Parameters

shouldUseCache

Whether the URL should use cached resource data from an already loaded URL that refers to the same resource. If YES, the cache is consulted when loading data. If NO, the data is always loaded directly, without consulting the cache.

Return Value

The receiver's resource data.

Discussion

If the receiver has not already loaded its resource data, it will attempt to load it as a blocking operation.

In OS X v10.4, this method requests that the data be sent with gzip compression, however it does not automatically decompress the data if the server complies with this request. Data is automatically decompressed in macOS 10.5 and later.

Special Considerations

Use the NSURLSession or NSURLConnection classes for loading content from remote URLs.

See Also

Deprecated

- initWithScheme:host:path:

Initializes a newly created NSURL with a specified scheme, host, and path.

Deprecated
- URLHandleUsingCache:

Returns a URL handle to service the receiver.

Deprecated
- loadResourceDataNotifyingClient:usingCache:

Loads the receiver’s resource data in the background.

Deprecated
- setResourceData:

Attempts to set the resource data for the receiver.

Deprecated
- propertyForKey:

Returns the specified property of the receiver’s resource.

Deprecated
- setProperty:forKey:

Changes the specified property of the receiver’s resource.

Deprecated