开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜