开发者

handling events with UITableView

This is what I am trying to do...but not sure how to do :

I have a tableview c开发者_JAVA百科onsisting of multiple rows in multiple sections. When I scroll the table going from 1 section to another, I want to do some other action - I want to have an action handler for this. But, I am not sure how to do it.

Cany anyone please help me out ? Thanks.


You can set the tableview delegate as the controller and implement this delegate function

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath

This function will get called before a cell is going to be displayed. You can use the indexpath to check if it is going to be first item in a section.

Hope this helps.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜