objective c - Blocks in Obj-C for performSelector: onThread:? -


while wouldn't hard spin own method this, wouldn't efficient as

- (void)performselector:(sel)aselector onthread:(nsthread *)thr withobject:(id)arg waituntildone:(bool)wait; 

is there built-in method blocks?

if not, there way can avoid creating object, putting block on it, , passing selector method? wonder if there problems data accessed within block...

the blocks equivalent performselector: method cfrunloopperformblock — need reference thread's cfrunloop.

have @ apple's documentation function , note caveat in discussion — you'll want call cfrunloopwakeup afterwards block executed right away.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -