Prevent uitableView from reloading

I am using uitableView

in my application and I want to prevent it from reloading in different cases: 1. When I present another modal look at it. 2. The row is selected.

I do not call [tableview reloadData]

in viewWillAppear

or viewDidAppear

. Is there a way to prevent this reboot?

+3


source to share


3 answers


Thank you for your responses. This does not trigger a reboot. I used auto layout and the constraints set on the tableview force it to reload and change position when another view appears. Solution: When making os presentation selection, use this command to prevent setting the position for constraints:



tableView.translatesAutoresizingMaskIntoConstraints = YES;

      

0


source


  • (voids) reloadData; // reloads everything from scratch. redisplays visible lines. because we only store information about visible rows, it is cheap. will adjust the offset if the table shrinks possibly, can do it in changing the DataSource


+1


source


Here's a way you can "track" when function calls come from:

example

  • Add a breakpoint in the header of the datasource table view function
  • Then start the app with the debugger open and when the breakpoint is pointing at the function header, click to the right of Thread 1 and you can see how this breakpoint was called / reached

Hope this helps you and I hope this was caused by you the programmer because as you can see in my example there was only one step I took. How can I tell the blue person icon next to6 -[ViewController viewDidLoad]

+1


source







All Articles