Выбрать UITableViewCell вместо UITextView, потеряв возможность вызывать метод делегата didSelectRowAtIndexPath?

У меня возникла проблема с выбором UITableViewCell. Я использую UITableViewCellс подпредставлением UITextView. Объект UITextViewнельзя редактировать, нельзя прокручивать, с включенным взаимодействием с пользователем.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    static NSString *CellIdentifier = @"Cell";    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {      
        cell=[[[NSBundle mainBundle]loadNibNamed:@"DemoCell" owner:self options:nil]objectAtIndex:0];         
        cell. accessoryType=UITableViewCellAccessoryDisclosureIndicator;
    }
      if([distanceArray count]){ 
        UILabel *label1=(UILabel*)[cell viewWithTag:1];      
        label1.text=[locationNameArray objectAtIndex:[indexPath section]];
        label1.textColor=[UIColor blueColor];
        UILabel *label2=(UILabel*)[cell viewWithTag:2];        
        [label2 setText:[distanceArray objectAtIndex:[indexPath section]]];
        UITextView *tview=(UITextView*)[cell viewWithTag:3];   
        [tview setText:[discriptionArray objectAtIndex:[indexPath section]]];         
        return cell;
      }
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

    DetailedLocationVIew *dView=[[DetailedLocationVIew alloc]initWithNibName:@"DetailedLocationVIew" bundle:nil];       
    [self.navigationController pushViewController:dView animated:YES];
    [dView release];
}

Если я выбираю ячейку поверх UITextView, делегат didSelectRowIndexPathне вызывается. Помимо более чем объекта UITextViewи выделения работает нормально? Почему выделение не работает над UITextView?

5
задан rishi 17 May 2012 в 10:29
поделиться