iPhone: cellForRowAtIndexPath - how to call it?
Assuming self.tableView is a UITableView instance variable that I created, can anyone explain the difference between these 2 statements? Both syntactically are correct, and I would think both would do the same thing: return a cell at self.tableView for that index p开发者_运维问答ath.
NSIndexPath myIndexPath = BLAH BLAH...
UITableViewCell *cell = [self tableView:self.tableView cellForRowAtIndexPath:myIndexPath];
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:myIndexPath];
The first sends a tableView:cellForRowAtIndexPath:
message to the table view's data source.
The second sends a cellForRowAtIndexPath:
message to the table view itself. The table view will, in turn, ask the data source for the cell.
精彩评论