Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flushing UITableView queue for cells

Tags:

iphone

I was wondering if some one can please reply me with if the UITableView queue gets flushed when UITableView reloadData is called.I am trying to do so and this isnt helping me.Any suggestions?

like image 926
Qamar Suleiman Avatar asked Dec 16 '22 18:12

Qamar Suleiman


1 Answers

if you look at the header file for UITableView, you can see that there is a private NSMutableDictionary (iVar) called "_reusableTableCells". This is a dictionary with cell reuse identifiers as key and with array with cells that are currently offscreen as value.

If you want to manually flush queued cells in way that may change with the implementation, you can do so in ugly manner, like so:

NSMutableDictionary *cells = (NSMutableDictionary*)[self.tableView valueForKey:@"_reusableTableCells"];
[cells removeAllObjects];

Hope this helps...

like image 51
joshis Avatar answered Dec 21 '22 23:12

joshis