UItableView reloadData reloads table from middle section
A strange thing. After I call [tableView reloadData]
, cellForRowAtIndexPath
being called with indexPath.section = 6
and not = 0. H开发者_StackOverflowow can this be, and how can I fix it?
You may want to reset your tableview to the top and then call reload if you want the display to start from the top.
[yourtableview scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:NO];
This is not because of your code . This is by default behavior, execution of cellForRowAtIndexPath
starts with last section thats 6 in your case and 0 row for that section.
By the way this does not create any kind of problem.
精彩评论