Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is can draw concurrently interface builder?

I have never used Can draw concurrently option mentioned in iterface builder. See image below:

enter image description here

Can someone explain me its use and purpose?

like image 268
RLT Avatar asked Nov 10 '11 13:11

RLT


1 Answers

You can use it to inform AppKit that your NSView subclass' -drawRect: instance method may be called from a secondary thread.

It's 10.6+. When/if AppKit renders views asynchronously, -drawRect: is performed using concurrent blocks, and your -drawRect: will be called from a secondary thread. This means your subclass' implementation must be threadsafe (for compatibility, it is disabled by default).

See also -[NSView setCanDrawConcurrently:] for details, because there are few things required to actually enable this behaviour. As well, it shouldn't imply that AppKit is threadsafe or that its NSView subclasses are designed to support this functionality - It's designed for your heavy drawing.

like image 119
justin Avatar answered Nov 11 '22 19:11

justin