Note that there are some explanatory texts on larger screens.

plurals
  1. POUITableViewRowData, numberOfSectionsInTableView
    primarykey
    data
    text
    <p>I was trying to understand why numberOfSectionsInTableView is being called multiple times each time I update my data source. From the stack trace in gdb, I see the following</p> <pre><code>#0 -[JobPickerTVC numberOfSectionsInTableView:] (self=0x4d61fe0, _cmd=0x6207f5, tableView=0x6034800) at JobPickerTVC.m:153 #1 0x003d66ff in -[UITableViewRowData(UITableViewRowDataPrivate) _updateNumSections] () #2 0x003d63b0 in -[UITableViewRowData invalidateAllSections] () #3 0x00299010 in -[UITableView(_UITableViewPrivate) _endCellAnimationsWithContext:] () #4 0x002891e8 in -[UITableView endUpdates] () #5 0x000050c8 in -[JobPickerTVC controllerDidChangeContent:] (self=0x4d61fe0, _cmd=0x17109d, controller=0x4da5e40) at JobPickerTVC.m:442 </code></pre> <p>followed by</p> <pre><code>#0 -[JobPickerTVC numberOfSectionsInTableView:] (self=0x4d61fe0, _cmd=0x6207f5, tableView=0x6034800) at JobPickerTVC.m:153 #1 0x003d66ff in -[UITableViewRowData(UITableViewRowDataPrivate) _updateNumSections] () #2 0x003d6417 in -[UITableViewRowData ensureAllSectionsAreValid] () #3 0x0029902e in -[UITableView(_UITableViewPrivate) _endCellAnimationsWithContext:] () #4 0x002891e8 in -[UITableView endUpdates] () #5 0x000050c8 in -[JobPickerTVC controllerDidChangeContent:] (self=0x4d61fe0, _cmd=0x17109d, controller=0x4da5e40) at JobPickerTVC.m:442 </code></pre> <p>From what I can tell, the code executes [UITableViewRowData <strong>invalidateAllSections</strong>] (line #2 of the first trace) and then [UITableViewRowData <strong>ensureAllSectionsAreValid</strong>] (line #2 of the second trace). Both of these end by calling [JobPickerTVC numberOfSectionsInTableView:]. So [JobPickerTVC numberOfSectionsInTableView:] is getting called twice. I would like to know why this is happening and what these operations are doing. </p> <p>There's one more call to numberOfSectionsInTableView for another reason, but I would like to understand these first. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload