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.)
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.hcanInitWithURL:
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.)
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.hregisterURLHandleClass:
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.)
Parameters
- aURLHandleSubclass
The new subclass to register as an available subclass.
Availability
- Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.hURLHandleClassForURL:
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.)
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.haddClient:
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.)
Parameters
- client
An object conforming to the
NSURLHandleClientprotocol.
Availability
- Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.havailableResourceData
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.)
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.hbackgroundLoadDidFailWithReason:
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.)
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.hbeginLoadInBackground
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.)
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.
See Also
Declared In
NSURLHandle.hcancelLoadInBackground
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.)
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.
See Also
Declared In
NSURLHandle.hdidLoadBytes: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.)
Parameters
- newBytes
The newly loaded bytes.
- done
YESif newBytes contains the last piece of data for the URL,NOotherwise.
Discussion
You should call this method when loading the resource data in the background.
Availability
- Deprecated in OS X v10.4 and later.
See Also
Declared In
NSURLHandle.hendLoadInBackground
Halts any background loading. (Deprecated in OS X v10.4 and later. Use NSURLConnection or NSURLDownload instead; see URL Loading System Programming Guide.)
Discussion
This method is called by cancelLoadInBackground.
Availability
- Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.hexpectedResourceDataSize
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.)
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.hfailureReason
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.)
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.hflushCachedData
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.)
Availability
- Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.hinitWithURL: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.)
Parameters
- aURL
The URL for the new handle.
- willCache
YESif the URL handle should cache its data and respond to requests from equivalent URLs for the cached data,NOotherwise.
Discussion
Subclasses of NSURLHandle must override this method.
Availability
- Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.hloadInBackground
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.)
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.
See Also
Declared In
NSURLHandle.hloadInForeground
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.)
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.hpropertyForKey:
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.)
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.hpropertyForKeyIfAvailable:
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.)
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.hremoveClient:
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.)
Parameters
- client
An object conforming to the
NSURLHandleClientprotocol.
Availability
- Deprecated in OS X v10.4 and later.
Declared In
NSURLHandle.hresourceData
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.)
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.hstatus
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.)
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.hwriteData:
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.)
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.hwriteProperty: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.)
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.
See Also
Declared In
NSURLHandle.h© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-02-04)