Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)setName:(NSString *)newName
- var queue = OperationQueue()
- queue.maxConcurrentOperationCount = 1
- queue.underlyingQueue = DispatchQueue(
- label: "my-queue-dispatch-queue", qos: .background)
- #import <Foundation/Foundation.h>
- @interface NameThreadOperation : NSOperation
- @end
- #import "NameThreadOperation.h"
- @implementation NameThreadOperation
- - (void)main
- {
- @autoreleasepool
- {
- [[NSThread currentThread] setName:@"Name of the thread"];
- }
- }
- @end
- operationQueue = [[NSOperationQueue alloc] init];
- #if defined(DEBUG)
- [self.operationQueue addOperation:[[NameThreadOperation alloc] init]];
- #endif
Add Comment
Please, Sign In to add comment