Last active
April 6, 2016 06:15
-
-
Save Drewsmits/6749279 to your computer and use it in GitHub Desktop.
NSURLSession Delegate Queue maxConcurrentOperationCount test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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:nil | |
delegateQueue:queue]; | |
NSLog(@"The queue after: %@", session.delegateQueue); | |
NSLog(@"Max op Count after : %i", session.delegateQueue.maxConcurrentOperationCount); | |
} | |
// The queue before: <NSOperationQueue: 0x165b2970>{name = 'NSOperationQueue 0x165b2970'} | |
// Max op Count before: 5 | |
// The queue after: <NSOperationQueue: 0x165db5f0>{name = 'NSOperationQueue 0x165db5f0'} | |
// Max op Count after : 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment