Deprecated NSURL Methods

A method identified as deprecated has been superseded and may become unsupported in the future.

Deprecated in OS X v10.4

loadResourceDataNotifyingClient:usingCache:

Loads the receiver’s resource data in the background. (Deprecated in OS X v10.4.)

- (void)loadResourceDataNotifyingClient:(id)client usingCache:(BOOL)shouldUseCache
Parameters
client

The client of the loading operation. client is notified of the receiver’s progress loading the resource data using the NSURLClient informal protocol. The NSURLClient messages are delivered on the current thread and require the run loop to be running.

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.

Discussion

A given NSURL object can perform only one background load at a time.

Special Considerations

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

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.4.
Declared In
NSURL.h

propertyForKey:

Returns the specified property of the receiver’s resource. (Deprecated in OS X v10.4.)

- (id)propertyForKey:(NSString *)propertyKey
Parameters
propertyKey

The key of the desired property.

Return Value

The value of the property of the receiver's resource for the provided key. Returns nil if there is no such key.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.4.
Declared In
NSURL.h

resourceDataUsingCache:

Returns the receiver’s resource data, loading it if necessary. (Deprecated in OS X v10.4.)

- (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 OS X v10.5 and later.

Special Considerations

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

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.4.
Declared In
NSURL.h

setProperty:forKey:

Changes the specified property of the receiver’s resource. (Deprecated in OS X v10.4.)

- (BOOL)setProperty:(id)propertyValue forKey:(NSString *)propertyKey
Parameters
propertyValue

The new value of the property of the receiver's resource.

propertyKey

The key of the desired property.

Return Value

Returns YES if the modification was successful, NO otherwise.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.4.
Declared In
NSURL.h

setResourceData:

Attempts to set the resource data for the receiver. (Deprecated in OS X v10.4.)

- (BOOL)setResourceData:(NSData *)data
Parameters
data

The data to set for the URL.

Return Value

Returns YES if successful, NO otherwise.

Discussion

In the case of a file URL, setting the data involves writing data to the specified file.

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.4.
Declared In
NSURL.h

URLHandleUsingCache:

Returns a URL handle to service the receiver. (Deprecated in OS X v10.4.)

- (NSURLHandle *)URLHandleUsingCache:(BOOL)shouldUseCache
Parameters
shouldUseCache

Whether to use a cached URL handle. If shouldUseCache is YES, the cache is searched for a URL handle that has serviced the receiver or another identical URL. If shouldUseCache is NO, a newly instantiated handle is returned, even if an equivalent URL has been loaded.

Return Value

A URL handle to service the receiver.

Discussion

Sophisticated clients use the URL handle directly for additional control.

Special Considerations

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

Availability
  • Available in OS X v10.0 and later.
  • Deprecated in OS X v10.4.
See Also
Declared In
NSURL.h