-
When a table invokes the cell for
-
row at index path method, it passes
the control object in index path.
-
In index path is a struct
that holds the row number.
-
In order to populate our table cells,
-
there are a few steps we need
to perform in this method.
-
The first step is to dequeue
a reusable cell from the table
-
using the correct reuse identifier.
-
The second step is to find the model
object that corresponds to the row
-
in question.
-
The third step is to set the images and
-
labels in the cell,
using the data from the model object.
-
And last, but not least,
return the cell.
-
For the favorite things app,
we'll use a standard table view cell.
-
It comes with a UI label property named,
text label, and
-
our reuse identifier will be,
FavoriteThingCell.
-
Here are three different implementations
of cell for row at index path.
-
Which of these three performs all four
of the steps previously outlined?
-
To try out the different methods,
-
check out the branch in
the instructor's notes.