This seems weird. I can't seem to seem to successfully set an NSURLSession's delegateQueue on creation.
- (void)viewDidLoad
{
[super viewDidLoad];
NSOperationQueue *queue = [[NSOperationQueue alloc] init];
queue.maxConcurrentOperationCount = 5;
NSLog(@"The queue before: %@", queue);
NSLog(@"Max op Count before: %i", queue.maxConcurrentOperationCount);
NSURLSession *session = [NSURLSession sessionWithConfiguration:nil
delegate:self
delegateQueue:queue];
NSLog(@"The queue after: %@", session.delegateQueue);
NSLog(@"Max op Count after : %i", session.delegateQueue.maxConcurrentOperationCount);
}
This results in the following output.
The queue before: <NSOperationQueue: 0x16d99160>{name = 'NSOperationQueue 0x16d99160'}
Max op Count before: 5
The queue after: <NSOperationQueue: 0x16d77a50>{name = 'NSOperationQueue 0x16d77a50'}
Max op Count after : 1
It looks like my delegateQueue
is being ignored. I've tried on the device as well as on the simulator. I've haven't found any documentation which would explain this. Does anyone have any insight?