Deprecated NSURLHandle Methods

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

Deprecated in OS X v10.4 and later

cachedHandleForURL:

Returns the URL handle from the cache that has serviced the specified URL or another identical URL. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

+ (NSURLHandle *)cachedHandleForURL:(NSURL *)aURL
Parameters
aURL

The URL whose cached URL handle is desired.

Return Value

The URL handle from the cache that has serviced aURL or another identical URL. Returns nil if there is no such handle.

Discussion

Subclasses of NSURLHandle must override this method.

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

canInitWithURL:

Returns whether a URL handle can be initialized with a given URL. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

+ (BOOL)canInitWithURL:(NSURL *)aURL
Parameters
aURL

The URL in question.

Return Value

YES if a URL handle can be initialized with aURL, NO otherwise.

Discussion

Subclasses of NSURLHandle must override this method to identify which URLs they can service.

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

registerURLHandleClass:

Registers a subclass of NSURLHandle as an available subclass for handling URLs (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

+ (void)registerURLHandleClass:(Class)aURLHandleSubclass
Parameters
aURLHandleSubclass

The new subclass to register as an available subclass.

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

URLHandleClassForURL:

Returns the class of the URL handle that will be used for a specified URL. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

+ (Class)URLHandleClassForURL:(NSURL *)aURL
Parameters
aURL

The URL in question.

Return Value

The class of the URL handle that will be used for aURL.

Discussion

Subclasses of NSURLHandle must be registered via the registerURLHandleClass: method. The subclass is determined by asking the list of registered subclasses if it canInitWithURL:; the first class to respond YES is selected.

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

addClient:

Adds a client of the URL handle. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

- (void)addClient:(id < NSURLHandleClient >)client
Parameters
client

An object conforming to the NSURLHandleClient protocol.

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

availableResourceData

Immediately returns the currently available resource data managed by the URL handle. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

- (NSData *)availableResourceData
Return Value

The currently available resource data managed by the URL handle. Returns nil if a previous attempt to load the data failed.

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

backgroundLoadDidFailWithReason:

Called when a background load fails. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

- (void)backgroundLoadDidFailWithReason:(NSString *)reason
Parameters
reason

The status message indicating why the background load failed.

Discussion

This method is provided mainly for subclasses that wish to take some action before passing along the failure notification to the URL client. This method should invoke super’s implementation before returning.

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

beginLoadInBackground

Called when a background load begins. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

- (void)beginLoadInBackground
Discussion

This method is provided mainly for subclasses that wish to take advantage of the superclass failure-reporting mechanism.

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

cancelLoadInBackground

Called to cancel a load currently in progress. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

- (void)cancelLoadInBackground
Discussion

This method is provided mainly for subclasses that wish to take some action before a background load is canceled. This method should invoke super’s implementation before returning.

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

didLoadBytes:loadComplete:

Appends new data to the receiver’s resource data. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

- (void)didLoadBytes:(NSData *)newBytes loadComplete:(BOOL)done
Parameters
newBytes

The newly loaded bytes.

done

YES if newBytes contains the last piece of data for the URL, NO otherwise.

Discussion

You should call this method when loading the resource data in the background.

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

endLoadInBackground

Halts any background loading. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

- (void)endLoadInBackground
Discussion

This method is called by cancelLoadInBackground.

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

expectedResourceDataSize

Returns the expected length of the resource data if it is provided by the server. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

- (long long)expectedResourceDataSize
Return Value

The expected size of the resource data, in bytes. A negative value if the length is unknown.

Discussion

This information can be queried before all the data has arrived.

Availability
  • Deprecated in OS X v10.4 and later.
  • Available in OS X v10.3 and later.
Declared In
NSURLHandle.h

failureReason

Returns a string describing the reason a load failed. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

- (NSString *)failureReason
Return Value

A string describing the reason a load failed. If the load has not failed, returns nil.

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

flushCachedData

Flushes any cached data for the URL served by this URL handle. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

- (void)flushCachedData
Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

initWithURL:cached:

Initializes a newly created URL handle with the specified URL. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

- (id)initWithURL:(NSURL *)aURL cached:(BOOL)willCache
Parameters
aURL

The URL for the new handle.

willCache

YES if the URL handle should cache its data and respond to requests from equivalent URLs for the cached data, NO otherwise.

Discussion

Subclasses of NSURLHandle must override this method.

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

loadInBackground

Loads the receiver’s data in the background. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

- (void)loadInBackground
Discussion

Each subclass determines its own loading policy. Clients should not assume that multiple background loads can proceed simultaneously. For example, a subclass may maintain only one thread for background loading, so only one background loading operation can be in progress at a time. If multiple background loads are requested, the later requests will wait in a queue until earlier requests are handled.

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

loadInForeground

Loads the receiver’s data synchronously. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

- (NSData *)loadInForeground
Return Value

The loaded data.

Discussion

Called by resourceData. Subclasses of NSURLHandle must override this method.

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

propertyForKey:

Returns the property for the specified key. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

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

The key of the desired property.

Return Value

The value associated with propertyKey. Returns nil if there is no such key.

Discussion

Subclasses of NSURLHandle must override this method.

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

propertyForKeyIfAvailable:

Returns the property for the specified key only if the value is already available; that is, the client doesn’t need to do any work. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

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

The key of the desired property.

Return Value

The value associated with propertyKey. Returns nil if there is no such key or if the client would have to do work to fetch the property.

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

removeClient:

Removes client as an NSURLHandleClient of the receiver. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

- (void)removeClient:(id < NSURLHandleClient >)client
Parameters
client

An object conforming to the NSURLHandleClient protocol.

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

resourceData

Returns the resource data managed by the receiver, loading it if necessary. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

- (NSData *)resourceData
Return Value

The resource data managed by the receiver.

Discussion

Blocks until all data is available.

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

status

Returns the status of the receiver. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

- (NSURLHandleStatus)status
Return Value

The status of the receiver. Possible return statuses are described in “Constants.”

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

writeData:

Attempts to write a specified set of data to the location specified by the receiver’s URL. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

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

The data to write.

Return Value

YES if successful, NO otherwise.

Discussion

Must be overridden by subclasses.

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h

writeProperty:forKey:

Sets the property of the receiver’s resource for a specified key to the specified value. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)

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

The new value for the property.

propertyKey

The key of the desired property.

Return Value

YES if the modification was successful, NO otherwise.

Discussion

Must be overridden by subclasses.

Availability
  • Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.h