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");
}
You need to call the completion block at the end of your method. like this:
-(void)configureRecorder:(void(^)(void))callback {
//@"Method"
callback()
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.