objective c - Is Block_copy recursive? -


i have code boils down this:

-(void)dosomethingwithblock:(blocktypedef)block {     [foo dosomethingelsewithblock:^() {         block();     }]; } 

foo dosomethingelsewithblock: calls block_copy , block_release on block receives. necessary @ outer scope, or inner block_copy handle this?

i quote blocks programming topics guide on apple's developer documentation site:

when copy block, references other blocks within block copied if necessary—an entire tree may copied (from top). if have block variables , reference block within block, block copied.

when copy stack-based block, new block. if copy heap-based block, however, increment retain count of block , returned value of copy function or method.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -