0
有沒有什麼辦法可以得到uitableview頭的indexpath?獲取UiTableView標頭的索引路徑?
我有以下代碼:
- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
static NSString *CellIdentifier = @"cell";
LocationCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil){
[NSException raise:@"headerView == nil.." format:@"No cells with matching CellIdentifier loaded from your storyboard"];
}
如上委託方法,沒有indexPath通過,可我得到頭的indexpath?
您可以在tableView:didSelectRowAtIndexPath方法中獲取indexPath, –
您是否指頭的indexPath.section? – anhtu
Anbu:當我點擊標題單元格時,無法調用didSelect。 anhtu:沒有,indexpath。 – Rendy