Guest User

Untitled

a guest
Jan 24th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. - (void)setName:(NSString *)newName
  2.  
  3. var queue = OperationQueue()
  4. queue.maxConcurrentOperationCount = 1
  5. queue.underlyingQueue = DispatchQueue(
  6. label: "my-queue-dispatch-queue", qos: .background)
  7.  
  8. #import <Foundation/Foundation.h>
  9.  
  10. @interface NameThreadOperation : NSOperation
  11.  
  12. @end
  13.  
  14. #import "NameThreadOperation.h"
  15.  
  16. @implementation NameThreadOperation
  17.  
  18. - (void)main
  19. {
  20. @autoreleasepool
  21. {
  22. [[NSThread currentThread] setName:@"Name of the thread"];
  23. }
  24. }
  25.  
  26. @end
  27.  
  28. operationQueue = [[NSOperationQueue alloc] init];
  29.  
  30. #if defined(DEBUG)
  31. [self.operationQueue addOperation:[[NameThreadOperation alloc] init]];
  32. #endif
Add Comment
Please, Sign In to add comment