I am in very complex issue of reloading UITableView!
I’ve a UITableView in which I am continuously (near by 10seconds), retrieving data from a server and showing that data in my UITableView that contains custom cells. The issue is that, when user (thats me) is scrolling through the UITableView it will crash due to an indexOutOfBound error as I am fetching data from the server the NSMutableArray will clear and fill again with data.
I also tried with a BOOL variable setting YES or NO in scrolling delegates. In this case if I scroll UITableView it will remove the cell of scroll direction, after 10 seconds it will show all cells with data.
But what I want is that, if user scrolls UITableView none of the created cell should hide! scrollEnabled is not a solution for that.
Please help me out!
Thanks 🙂
this is a thread unsafe code issue. data source being modified while it is being actively used.
one safe solution would be to feed all data after parsing to some DB (sqlite/Coredata) and reload the table datasource from db and call reloadData for table. this way at the time when you were using the datasource array – it wont be empty.
best of luck