objective c - UITableView afnetworking images swap positions -
i have problem tableview , images in cells. load images use afnetworking following code:
[celle.thumb setimagewithurlrequest:[nsurlrequest requestwithurl:myimglink] placeholderimage:[uiimage imagenamed:@"placeholder.png"] success:^(nsurlrequest *request , nshttpurlresponse *response , uiimage *image ){ if (request) { //fade animation [uiview transitionwithview:celle.thumb duration:0.8f options:uiviewanimationoptiontransitioncrossdissolve animations:^{ [celle.thumb setimage:image]; } completion:null]; } } failure:^(nsurlrequest *request, nshttpurlresponse *response, nserror *error){ } ]; this code work expected , tableview looks this
but now, when scroll down, , again - images mixed. swapped places or dont know. , don't have idea how solve problem. thats looks after scrolling down , up.
would happy me.
the issue using dequeuereusablecellwithidentifier create cells in cellforrowatindexpath method. means when new cell needs shown on screen (like when scroll) old cell in view used new one.
this isn't issue long explicitly set in cell in method cellforrowatindexpath. looks setting placeholderimage might not working. maybe set image line before setimagewithurlrequest.
Comments
Post a Comment