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
Post a Comment