Reputation: 699
Is it possible to find section of row where I am clicking in tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath method.
TIA
Upvotes: 2
Views: 3565
Reputation: 1145
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:
(NSIndexPath*)indexPath{
int section = [indexPath section];
NSLog(@"section %d",section);
}
Upvotes: 2
Reputation: 434
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
int section = [indexPath section];
}
Upvotes: 2
Reputation: 7963
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if(indexPath.section==0)
{
// 1st Section of the tableView.
if(indexPath.row==0)
{
// 1st cell of the 1st section.
}
}
}
Upvotes: 2
Reputation: 3143
the indexPath parameter has section property accessible as following
[indexPath section];
OR
indexPath.section
Upvotes: 10