Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to prevent dequeue-ing a visible cell in GMGridView
    primarykey
    data
    text
    <p>I'm using <a href="https://github.com/gmoledina/GMGridView" rel="nofollow">GMGridView</a> which is fantastic for supporting grid views. But I'm encountering problems regarding the way it dequeues cells.</p> <p>Some background info on my app: I have a class named 'ProductsGVC' which presents a grid view of products belonging to a certain 'Category'. ProductsGVC's data model is an array of products taken from an instance of a 'Category'.</p> <p>My GMGridView creates 250 cells at a time. As I load each cell, I have a thread that downloads an image for each cell. While waiting for it to finish downloading, I put a default image in the cell's image view. Logically, after downloading the cell, I want to reload the cell to update the photo. I'm successful at doing this using this code:</p> <pre><code>//_currentData is my array of products [_gmGridView reloadObjectAtIndex:[_currentData indexOfObject:product] animated:YES]; </code></pre> <p>However, if the a cell that is in the bottom part of my array is updated, the cell is refreshed properly but 1 cell disappears.</p> <p>My inefficient solution is to call <code>[_gmGridView reloadData]</code> anytime a cell finishes downloading its image. The result is, the cells I've loaded before, disappear. I'm guessing their dequeued and reused. Well, they do appear again when I scroll a number of times away from those cells that disappeared. </p> <p>My question is, how do I prevent dequeue-ing a visible cell (i.e. a cell that is currently on-screen)?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload