开发者

iPhone: cellForRowAtIndexPath - how to call it?

开发者 https://www.devze.com 2023-03-23 05:11 出处:网络
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

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

精彩评论

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