Just as the question's title mentions:
What's the difference between "
You are right, cell configuration can (in theory) be done in both methods.
However, almost all
UITableView have a data source which implements
cellForRowAtIndexPath: (it is a required method in the protocol). On the other hand, the
willDisplayCell:forRowAtIndexPath: (which is a method of the delegate, not the data source) is optional.
As configuring a cell is usually dependent on the data you want to show,
cellForRowAtIndexPath: is by far the most common place to do cell configuration. (I can't even remember using
There's one notable exception: when you are using a storyboard and static cells (instead of cell prototypes), you can't do anything useful in
nil), so you have to do configuration in
viewWillAppear: or other methods.
@NSDeveloper: you're right. Thanks for the hint.