Initially, when adding new BNRItems, we send the message insertRowsAtIndexPaths:withRowAnimation: in addNewItem:. My understanding of the sequence of method calls from addNewItem: is this.
- Create newBNRItem with createItem
- Send the message insertRowsAtIndexPaths:withRowAnimation: to insert a row into the table view. This does not put content in the row, it just creates the row in the table
- The method tableView:numberOfRows:inSection: is called to return the number of rows in the table view (of the given section)
- The method tableView:cellForRowAtIndexPath: is called to ask the data source for a cell of data to insert at a given location in the table view. Here is where that actual data is loaded into the table
Then, we modified addNewItem: and no longer call insertRowsAtIndexPaths:withRowAnimation:. Instead we create a DetailViewController, copy the BNRItem into the controller’s item property and present it modally from a navigation controller.
- Is my understanding of the sequence of method calls correct?
- How are new rows created in the table view without sending the insertRowsAtIndexPaths:withRowAnimation: message?
- Another way to ask the previous question: Where is the cell with data inserted in the table if a row for it has not been created?
I feel I’m missing something basic, but I don’t know what it is.