I have a value that I’m retrieving from a block that I’d like to return in the below method. Being that it appears the block is asynchronous, how can I accomplish this?
-(UIImage*) imageAtIndex:(NSUInteger)index
{
UIImage *image;
[self.album enumerateAssetsAtIndexes:[NSIndexSet indexSetWithIndex:index] options:0 usingBlock: ^(ALAsset *result, NSUInteger index, BOOL *stop)
{
//set image in here
}];
return image;
}
I had done it like this in the past, check it.