Ahsan
Ahsan

Reputation: 2982

handling events with UITableView

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

I have a tableview consisting 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.

Upvotes: 0

Views: 152

Answers (1)

imthi
imthi

Reputation: 4798

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.

Upvotes: 1

Related Questions