- (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/