Crash while custom IPhoto Protocol Implement
enefry opened this issue · comments
Why not declare in IDMPhoto protocol instead force convert ?
- (void)configurePage:(IDMZoomingScrollView *)page forIndex:(NSUInteger)index {
page.frame = [self frameForPageAtIndex:index];
page.tag = PAGE_INDEX_TAG_OFFSET + index;
page.photo = [self photoAtIndex:index];
__block __weak IDMPhoto *photo = (IDMPhoto*)page.photo; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
__weak IDMZoomingScrollView* weakPage = page;
photo.progressUpdateBlock = ^(CGFloat progress){
[weakPage setProgress:progress forPhoto:photo];
};
}