{"action":"created","issue":{"url":"https://api.github.com/repos/rs/SDWebImage/issues/1546","repository_url":"https://api.github.com/repos/rs/SDWebImage","labels_url":"https://api.github.com/repos/rs/SDWebImage/issues/1546/labels{/name}","comments_url":"https://api.github.com/repos/rs/SDWebImage/issues/1546/comments","events_url":"https://api.github.com/repos/rs/SDWebImage/issues/1546/events","html_url":"https://github.com/rs/SDWebImage/issues/1546","id":152858909,"number":1546,"title":"SDImageCache queryDiskCacheForKey in collectionView","user":{"login":"Sneakr","id":13436463,"avatar_url":"https://avatars.githubusercontent.com/u/13436463?v=3","gravatar_id":"","url":"https://api.github.com/users/Sneakr","html_url":"https://github.com/Sneakr","followers_url":"https://api.github.com/users/Sneakr/followers","following_url":"https://api.github.com/users/Sneakr/following{/other_user}","gists_url":"https://api.github.com/users/Sneakr/gists{/gist_id}","starred_url":"https://api.github.com/users/Sneakr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sneakr/subscriptions","organizations_url":"https://api.github.com/users/Sneakr/orgs","repos_url":"https://api.github.com/users/Sneakr/repos","events_url":"https://api.github.com/users/Sneakr/events{/privacy}","received_events_url":"https://api.github.com/users/Sneakr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-05-03T19:47:40Z","updated_at":"2016-05-04T19:52:24Z","closed_at":"2016-05-04T05:35:27Z","body":"Hi, \r\n\r\nThis is my code to check for disk image in a collectionView inside a cell subclass:\r\n\r\n[_cellImageCache queryDiskCacheForKey:mediaContentKey done:^(UIImage *image, SDImageCacheType cacheType) {\r\n        if (image) {\r\n            weakImageView.image = image;\r\n        }\r\n\r\nIt works fine fetching the image from disk cache. But what happens is : \r\n\r\nWhen i scroll the collectionview fast, it seems to run all the \"queryDiskCacheForKey\" on all the cells that scroll by, and when I stop the scroll, the imageView.image sets to all the different images from all the querys until the correct cell image sets in.\r\n\r\nIs there any way to cancel the disk query requests while im scrolling, for example in \r\n- (void)prepareForReuse ?\r\n\r\nEdit:\r\nI have tried to run the code outside the Cell subclass inside the \"cellForItemAtIndexPath\", but the results are the same."},"comment":{"url":"https://api.github.com/repos/rs/SDWebImage/issues/comments/216981991","html_url":"https://github.com/rs/SDWebImage/issues/1546#issuecomment-216981991","issue_url":"https://api.github.com/repos/rs/SDWebImage/issues/1546","id":216981991,"user":{"login":"Sneakr","id":13436463,"avatar_url":"https://avatars.githubusercontent.com/u/13436463?v=3","gravatar_id":"","url":"https://api.github.com/users/Sneakr","html_url":"https://github.com/Sneakr","followers_url":"https://api.github.com/users/Sneakr/followers","following_url":"https://api.github.com/users/Sneakr/following{/other_user}","gists_url":"https://api.github.com/users/Sneakr/gists{/gist_id}","starred_url":"https://api.github.com/users/Sneakr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sneakr/subscriptions","organizations_url":"https://api.github.com/users/Sneakr/orgs","repos_url":"https://api.github.com/users/Sneakr/repos","events_url":"https://api.github.com/users/Sneakr/events{/privacy}","received_events_url":"https://api.github.com/users/Sneakr/received_events","type":"User","site_admin":false},"created_at":"2016-05-04T19:52:24Z","updated_at":"2016-05-04T19:52:24Z","body":"Awesome bro! Really great. Thanks again for taking your time! :) "}}