“堆叠”块?

时间:2014-05-15 02:45:28

标签: objective-c objective-c-blocks

是否可以在另一个块中调用块?

例如:

-(void)doSomethingWithBlock:(void (^)(id))parameterBlock{

     Blah * object = [Blah doThisblock:^(id sender) {

     //invoke "parameterBlock" here..

     // do other things after as well..

     }
 }

如果可能的话,我该怎么做呢?

1 个答案:

答案 0 :(得分:0)

我发现我可以通过这样做来调用块:

    -(void)doSomethingWithBlock:(void (^)(id))parameterBlock{

            Blah * object = [Blah doThisblock:^(id sender) {

                   parameterBlock();

                   // do other things after as well..

           }
     }