Please consider this sample code:
- (long)someMethod {
long returnValue;
[MFPDFConverter createPDFFromEmail:emailToConvert completionHandler:^(long longObtainedFromBlock) {
NSLog(@"Here we are");
returnValue = longObtainedFromBlock;
}];
return returnValue;
}
How can I refactor the method to wait for the block to end before returning the value ? Thanks for your attention.