O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSURLHandle — Mac OS X 10.0

Synopsis

NSURLHandle provides an interface for uploading and downloading data to and from a resource specified by an NSURL. NSURLHandle actually offloads much of this work to subclasses that implement NSURLHandle’s interface to work with various schemes.

image with no caption

@interface NSURLHandle : NSObject
                                  // Class Methods
   + (Class)URLHandleClassForURL:(NSURL *)anURL;
   + (NSURLHandle *)cachedHandleForURL:(NSURL *)anURL;
   + (BOOL)canInitWithURL:(NSURL *)anURL;
   + (void)registerURLHandleClass:(Class)anURLHandleSubclass;
                                  // Instance Methods
   - (void)addClient:(id <NSURLHandleClient>)client;
   - (id) initWithURL:(NSURL *)anURL 
                                 cached:(BOOL)willCache;
   - (NSData *)availableResourceData;
   - (void)backgroundLoadDidFailWithReason:(NSString *)reason;
   - (void)beginLoadInBackground;
   - (void)cancelLoadInBackground;
   - (void)didLoadBytes:(NSData *)newBytes 
                                 loadComplete:(BOOL)yorn;
   - (void)endLoadInBackground;
   - (NSString *)failureReason;
   - (void)flushCachedData;
   - (void)loadInBackground;
   - (NSData *)loadInForeground;
   - (id)propertyForKey:(NSString *)propertyKey;
   - (id)propertyForKeyIfAvailable:(NSString *)propertyKey;
   - (void)removeClient:(id <NSURLHandleClient>)client;
   - (NSData *)resourceData;
   - (NSURLHandleStatus)status;
   - (BOOL)writeData:(NSData *)data;
   - (BOOL)writeProperty:(id)propertyValue 
                                 forKey:(NSString *)propertyKey;

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required