是否可以在 tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 方法中找到我单击的行部分。
TIA
是否可以在 tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 方法中找到我单击的行部分。
TIA
indexPath 参数具有可访问的部分属性,如下所示
[indexPath section];
或者
indexPath.section
-(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.
}
}
}
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
int section = [indexPath section];
}
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:
(NSIndexPath*)indexPath{
int section = [indexPath section];
NSLog(@"section %d",section);
}