Return to Video

04-14 Implementing cellForRowAtIndexPath

  • 0:00 - 0:02
    When a table invokes the cell for
  • 0:02 - 0:06
    row at index path method, it passes
    the control object in index path.
  • 0:06 - 0:09
    In index path is a struct
    that holds the row number.
  • 0:09 - 0:12
    In order to populate our table cells,
  • 0:12 - 0:15
    there are a few steps we need
    to perform in this method.
  • 0:15 - 0:18
    The first step is to dequeue
    a reusable cell from the table
  • 0:18 - 0:21
    using the correct reuse identifier.
  • 0:21 - 0:24
    The second step is to find the model
    object that corresponds to the row
  • 0:24 - 0:25
    in question.
  • 0:26 - 0:28
    The third step is to set the images and
  • 0:28 - 0:31
    labels in the cell,
    using the data from the model object.
  • 0:31 - 0:34
    And last, but not least,
    return the cell.
  • 0:34 - 0:37
    For the favorite things app,
    we'll use a standard table view cell.
  • 0:37 - 0:41
    It comes with a UI label property named,
    text label, and
  • 0:41 - 0:43
    our reuse identifier will be,
    FavoriteThingCell.
  • 0:45 - 0:49
    Here are three different implementations
    of cell for row at index path.
  • 0:49 - 0:54
    Which of these three performs all four
    of the steps previously outlined?
  • 0:54 - 0:55
    To try out the different methods,
  • 0:55 - 0:57
    check out the branch in
    the instructor's notes.
Title:
04-14 Implementing cellForRowAtIndexPath
Description:

04-14 Implementing cellForRowAtIndexPath

more » « less
Video Language:
English
Team:
Udacity
Project:
UD788 - UIKit Fundamentals
Duration:
0:58
There has been no activity on this language so far.

English subtitles

Revisions Compare revisions