ios - 修复触摸在 UITableViewCell 内的 UILabel 上不起作用?

标签 ios objective-c uitableview uitouch

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

{
    if (tableView == sessionListTable){
        selectedSessionId = [[self.sessionNames objectAtIndex:indexPath.row] objectForKey:@"session_id"];
        selectedSessionName = [[self.sessionNames objectAtIndex:indexPath.row] objectForKey:@"session_name"];
        NSLog(@"%@",selectedSessionId);
        [StudentCommon sharedInstance].mTeacherSessionId = selectedSessionId;
        [self remoteSessionButtonClick];
        currentIndexPath = indexPath;
        previousIndexPath = currentIndexPath;
        [sessionListTable reloadData];
        [sessionListPopUp removeFromSuperview];
    }

表格 View 中的 UILabel` 不响应触摸,尽管触摸仅在单元格的空白区域有效。

验证所有连接、约束和类。

最佳答案

  • Attribute Inspector 中检查内部 UI 元素的所有属性,
  • 确保所有用户交互都已“勾选”☑️
  • 检查 User Defined Runtime Attributes 中的属性并删除哪些是 不需要。
  • 检查类名称是否是正确的“ super 类”/“相关自定义类”。
  • Connections Inspector 中检查连接是否有任何警告 ⚠️,如果存在警告,请移除连接并重新连接。

This is the image showing the User Defined Runtime Attributes, which was causing this error

关于ios - 修复触摸在 UITableViewCell 内的 UILabel 上不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55968234/

相关文章:

ios - HTML5 视频量

ios - Swift - 从一年中的某一天获取日期

iphone - 根据道路计算两个位置之间的距离

ios - 如何在 UITableView 中禁用排序

ios - 将 subview 添加到自定义 viewForHeaderInSection 会破坏 VoiceOver 导航

ios - 2个MKA注释之间的距离?

iphone - 计算不同时区对应的日期和时间

iphone - 在哪个线程中调用 iOS 完成处理程序 block ?

iphone - 静态的 Objective-C 修饰符?

iphone - 返回 TableView 时如何更改 UITableViewController 的选定单元格?