- Inherits From:
- URLManager
- Declared In:
- URLStackManager.h
This manager does not handle HTTP POST requests that have the same URL but different request data; adding one request and then another with the same URL will cause the earlier request to be removed.
BE SURE to invoke detachConsumer on this object before deallocating this in your class's release method.
Synopsis:
NSString *URLStackManagerChangeNotification;
NSMutableArray *mWaitingURLs;
NSMutableArray *mWaitingOptions;
NSMutableArray *mWaitingParams;
int mLoadingMax;
int mWaitingMax;
mWaitingURLs No description. mWaitingOptions No description. mWaitingParams No description. mLoadingMax No description. mWaitingMax No description.
Initialization and LoadingStatus and control
- - initWithDescriptor:consumer:progress:success:cancelled:error:loaders:capacity:
- - initWithDescriptor:consumer:progress:loaders:capacity:
- - loadURL:options:parameter:
- - stopLoading
- - stopLoadingParameter:
- - isDone
- - status
- - stackArray
- (id)initWithDescriptor:(NSString *)inDescriptor consumer:(id)inConsumer progress:(NSProgressIndicator *)inProgress loaders:(int)inConcurrent capacity:(int)inCapacity
Initialize a URLStackManager to invoke the default methods upon completion: loadSuccess:handle:parameter:, loadCancelledParameter:, and loadError:parameter:. See initWithDescriptor:consumer:progress:success:cancelled:error:loaders:capacity.
- (id)initWithDescriptor:(NSString *)inDescriptor consumer:(id)inConsumer progress:(NSProgressIndicator *)inProgress success:(SEL)inSuccess cancelled:(SEL)inCancelled error:(SEL)inError loaders:(int)inConcurrent capacity:(int)inCapacity
Initialize a new URLStackManager. inDescriptor is a string to describe the purpose of the broker (for debugging uses). inConsumer is the object (another LoadBroker subclass, or any object that will respond to the completion methods) to be passed the completion methods. inSuccess, inCancelled, and inError are the selectors to invoke upon completion; these should be methods with the same signature as loadSuccess:handle:parameter:, loadCancelledParameter:, and loadError:parameter:. inConcurrent is the number of concurrent loaders that may be going at a time. inCapacity is the total number of loading and waiting URLs that may be stored before requests are lost.
- (BOOL)isDone
Returns true if done loading; that is, no loaders remain and no requests are still stacked up.
- (void)loadURL:(NSURL *)inURL options:(NSDictionary *)inOptions parameter:(id)inParam
Begin loading inURL in the background, or if the maximum number of concurrent loads is reached, stack up the load for loading as soon as possible. inOptions are passed to the URLLoader. inParam is any object that is passed back to the consumer when the load finishes so the consumer can recognize what finished loading; it might be a string, a dictionary, for example.
- (NSArray *)stackArray
Return the waiting stack; for debugging purposes.
- (NSString *)status
Returns a status string; useful for debugging or displaying to the user to show how many items are still loading and how many are waiting.
- (void)stopLoading
Stop loading all pending and stacked-up URLs. This might be done in response to a "Cancel All" button or some such.
- (void)stopLoadingParameter:(id)inParam
Stop loading url with given parameter