Starts the queue.
// instantiate the shared network queue NetworkQueue* networkQueue = [NetworkQueue queue]; // set various delegates and selectors // subscribe for download progress notifications [networkQueue setDownloadProgressDelegate:self]; // for accurate progress tracking [networkQueue setShowAccurateProgress:YES]; // register ourselves as delegate [networkQueue setDelegate:self]; [networkQueue setRequestDidFailSelector:(downloadFailed:)]; [networkQueue setRequestDidFinishSelector:(downloadFinished:)]; [networkQueue setQueueDidFinishSelector:(queueFinished:)]; //there is no queueFailed selector: the queue is always finished even if some or all the belonging requests fail // create and add the requests (internally an NSOperationQueue is used to store and concurrently handle the requests) // Request#1 Request* request = [Request requestWithUrl:[NSURL URLWithString:"http://www.yahoo.com"]]; [networkQueue addOperation:request];
// start the queue (all operations are on hold when added) [networkQueue startBatch];