I'm trying to understand blocks a bit more.
I have these definitions:
@property (nonatomic, retain) NSMutableArray * callBacksOnSuccess;
@property (nonatomic, copy) void (^callBackSuccessWithUIImage) (UIImage *) ;
When the image download finishes I do this in the completion block and things are fine
UIImage *coverImage = [UIImage imageWithData:data];
callBackSuccessWithUIImage(coverImage);
Now I'd like to be able to do same for all callback blocks stored in the callBacksOnSuccess NSMutableArray but I don't know how to approach this.
I'm trying a for in loop, but that's not working most likely because of the ambigous id class definition:
UIImage *coverImage = [UIImage imageWithData:data];
for (id callBackBlock in callBacksOnSuccess)
{callBackBlock(coverImage);}
Please push me towards the right approach.
thank you!