Objective C completion block doesn't get called

833 Views Asked by At

I am trying to call a completion block in a unit test but it never reaches. Here is the code:

[vc configureRecorder:^{
    NSLog(@"Completion...");
}];

This is the method:

-(void)configureRecorder:(void(^)(void))callback {
    NSLog(@"Method");
}
1

There are 1 best solutions below

0
Enrique Bermúdez On BEST ANSWER

You need to call the completion block at the end of your method. like this:

-(void)configureRecorder:(void(^)(void))callback {
    //@"Method"
    callback()
}