-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cell being populated with wrong images #1024
Comments
@marcustoy in your cell subclass add the prepareforreuse method and nullify the image in your imageview |
@mythodeia Thanks a lot! It solves the problem!!! You save my several hours of debugging and searching online. Thanks again!! |
Hi @mythodeia , |
@siddhesh12 there must be a cell reuse issue somewhere hidden in your code. check the demo project to see how it works. if still you have issues please share a demo project so everyone can take a look and help |
I got the solution for it. at the beginning I am calling sd_cancelImageLoadForState method. so when image gets download asynchronously it will never assign it to different cell which was previously reused. This was only used to happen when some cell do not have url from data model. |
Before setting new image to imageView add:
|
Hi,
I'm currently using this code to set-up my images:
[cell.coverImage sd_setImageWithURL:[self.dataInJSONModel.Content[indexPath.row] CoverImage] placeholderImage:[UIImage imageNamed:@"imageplaceholder_general"]];
And my cells are often wrongly populated when I scroll. Guessed it is due to the cell reuse issue, where the async-downloaded images are populated to the cell that may have been re-used/disappeared. I have searched online and tried those recommendations but to no avail. Any standard method to solving this problem?
The text was updated successfully, but these errors were encountered: