Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef void(^LoopBlock)(dispatch_block_t, int);
- LoopBlock *loop_blk = malloc(sizeof(LoopBlock));
- *loop_blk = ^(dispatch_block_t done_blk, int i) {
- ((i > 0)
- ? (printf("executing loop %d more times\n", i),
- (*loop_blk)(done_blk, i - 1))
- : (done_blk(), free(loop_blk)));
- };
- (*loop_blk)(^{ printf("ok done\n"); }, 20);
Add Comment
Please, Sign In to add comment