Misha
Misha

Reputation: 5380

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. How can this be, and how can I fix it?

Upvotes: 1

Views: 568

Answers (2)

Praveen S
Praveen S

Reputation: 10393

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];

Upvotes: 1

Ishu
Ishu

Reputation: 12787

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.

Upvotes: 1

Related Questions