A method identified as deprecated has been superseded and may become unsupported in the future.
Returns the URL handle from the cache that has serviced the specified URL or another identical URL. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
+ (NSURLHandle *)cachedHandleForURL:(NSURL *)aURL
The URL whose cached URL handle is desired.
The URL handle from the cache that has serviced aURL or another identical URL. Returns nil
if there is no such handle.
Subclasses of NSURLHandle
must override this method.
NSURLHandle.h
Returns whether a URL handle can be initialized with a given URL. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
+ (BOOL)canInitWithURL:(NSURL *)aURL
The URL in question.
YES
if a URL handle can be initialized with aURL, NO
otherwise.
Subclasses of NSURLHandle
must override this method to identify which URLs they can service.
NSURLHandle.h
Registers a subclass of NSURLHandle
as an available subclass for handling URLs (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
+ (void)registerURLHandleClass:(Class)aURLHandleSubclass
The new subclass to register as an available subclass.
NSURLHandle.h
Returns the class of the URL handle that will be used for a specified URL. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
+ (Class)URLHandleClassForURL:(NSURL *)aURL
The URL in question.
The class of the URL handle that will be used for aURL.
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.
NSURLHandle.h
Adds a client of the URL handle. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
- (void)addClient:(id < NSURLHandleClient >)client
An object conforming to the NSURLHandleClient
protocol.
NSURLHandle.h
Immediately returns the currently available resource data managed by the URL handle. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
- (NSData *)availableResourceData
The currently available resource data managed by the URL handle. Returns nil
if a previous attempt to load the data failed.
NSURLHandle.h
Called when a background load fails. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
- (void)backgroundLoadDidFailWithReason:(NSString *)reason
The status message indicating why the background load failed.
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.
NSURLHandle.h
Called when a background load begins. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
- (void)beginLoadInBackground
This method is provided mainly for subclasses that wish to take advantage of the superclass failure-reporting mechanism.
NSURLHandle.h
Called to cancel a load currently in progress. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
- (void)cancelLoadInBackground
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.
NSURLHandle.h
Appends new data to the receiver’s resource data. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
- (void)didLoadBytes:(NSData *)newBytes loadComplete:(BOOL)done
The newly loaded bytes.
YES
if newBytes contains the last piece of data for the URL, NO
otherwise.
You should call this method when loading the resource data in the background.
NSURLHandle.h
Halts any background loading. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
- (void)endLoadInBackground
This method is called by cancelLoadInBackground
.
NSURLHandle.h
Returns the expected length of the resource data if it is provided by the server. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
- (long long)expectedResourceDataSize
The expected size of the resource data, in bytes. A negative value if the length is unknown.
This information can be queried before all the data has arrived.
NSURLHandle.h
Returns a string describing the reason a load failed. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
- (NSString *)failureReason
A string describing the reason a load failed. If the load has not failed, returns nil
.
NSURLHandle.h
Flushes any cached data for the URL served by this URL handle. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
- (void)flushCachedData
NSURLHandle.h
Initializes a newly created URL handle with the specified URL. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
- (id)initWithURL:(NSURL *)aURL cached:(BOOL)willCache
The URL for the new handle.
YES
if the URL handle should cache its data and respond to requests from equivalent URLs for the cached data, NO
otherwise.
Subclasses of NSURLHandle
must override this method.
NSURLHandle.h
Loads the receiver’s data in the background. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
- (void)loadInBackground
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.
NSURLHandle.h
Loads the receiver’s data synchronously. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
- (NSData *)loadInForeground
The loaded data.
Called by resourceData
. Subclasses of NSURLHandle must override this method.
NSURLHandle.h
Returns the property for the specified key. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
- (id)propertyForKey:(NSString *)propertyKey
The key of the desired property.
The value associated with propertyKey. Returns nil
if there is no such key.
Subclasses of NSURLHandle must override this method.
NSURLHandle.h
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 Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
- (id)propertyForKeyIfAvailable:(NSString *)propertyKey
The key of the desired property.
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.
NSURLHandle.h
Removes client as an NSURLHandleClient
of the receiver. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
- (void)removeClient:(id < NSURLHandleClient >)client
An object conforming to the NSURLHandleClient
protocol.
NSURLHandle.h
Returns the resource data managed by the receiver, loading it if necessary. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
- (NSData *)resourceData
The resource data managed by the receiver.
Blocks until all data is available.
NSURLHandle.h
Returns the status of the receiver. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
- (NSURLHandleStatus)status
The status of the receiver. Possible return statuses are described in “Constants.”
NSURLHandle.h
Attempts to write a specified set of data to the location specified by the receiver’s URL. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
- (BOOL)writeData:(NSData *)data
The data to write.
YES
if successful, NO
otherwise.
Must be overridden by subclasses.
NSURLHandle.h
Sets the property of the receiver’s resource for a specified key to the specified value. (Deprecated in Mac OS X v10.4 and later. Use NSURLConnection
or NSURLDownload
instead; see URL Loading System.)
- (BOOL)writeProperty:(id)propertyValue forKey:(NSString *)propertyKey
The new value for the property.
The key of the desired property.
YES
if the modification was successful, NO
otherwise.
Must be overridden by subclasses.
NSURLHandle.h
© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-02-04)