Multiple threads to draw in NSView
问题 In my code, I subclassed NSView and in its drawRect method, I am spawning three threads to perform the drawing. -(void)drawRect:(NSRect)dirtyRect { [[self window] setAllowsConcurrentViewDrawing:YES]; [self setCanDrawConcurrently:YES]; [NSThread detachNewThreadSelector:@selector(DrawText) toTarget:self withObject:nil]; [NSThread detachNewThreadSelector:@selector(DrawRectangle) toTarget:self withObject:nil]; [NSThread detachNewThreadSelector:@selector(DrawGradient) toTarget:self withObject:nil]