I have a section in UITableView which has multiple rows. I wish to get the last row or the last cell of the section to add a disclosure indicator on it.
One way I am
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
//Section 0
if (indexPath.section == 0) {
// Is Last row?
if ([dataSouceArray count] == (indexPath.row+1)) {
//Yes
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
}
else{
// other rows
cell.accessoryType = UITableViewCellAccessoryNone;
}
}
}