Вопрос

Is it possible to invoke a block within another block?

For example:

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

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

     //invoke "parameterBlock" here..

     // do other things after as well..

     }
 }

If possible, how would I go about doing it?

Это было полезно?

Решение

I found that I could call the block by doing this:

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

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

                   parameterBlock();

                   // do other things after as well..

           }
     }
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top