iphone - Images appear after scrolling table view (AFNetworking) -
i using afnetworking download images server , works fine images wont't appear unless scroll table view . here code :
- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"cell"; uitableviewcell*cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstylesubtitle reuseidentifier:cellidentifier]; } //configuring news feed dictionary = [newsfeed objectatindex:indexpath.row]; //display thumbnails uiimageview *image = [[uiimageview alloc]init]; [image setimagewithurl:[nsurl urlwithstring:[dictionary objectforkey:@"image"]]placeholderimage:[uiimage imagenamed:newsavatar]]; cell.imageview.image = [image.image imagescaledtosize:cgsizemake(55, 55)]; [cell setneedslayout]; return cell; }
try this
[ cell.imageview.image setimagewithurl:[nsurl urlwithstring:[dictionary objectforkey:@"image"]]placeholderimage:[uiimage imagenamed:newsavatar]];
Comments
Post a Comment