gpt4 book ai didi

objective-c - 按下自定义单元格文本标签时,didSelectRowAt Index 不会触发

转载 作者:行者123 更新时间:2023-11-28 17:33:30 24 4
gpt4 key购买 nike

didSelectRowAtIndex 当我按下单元格的 UITextLabel 时不会触发,即使当我触摸它周围的空白区域时它也会触发。我还注意到这个问题只发生在 iPad 上。在 iPhone 上一切正常。我使用在 IB 中设计的自定义单元格。这是我的代码:

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

NSString *key = [[self sectionKeys] objectAtIndex:[indexPath section]];
NSArray *contents = [[self sectionContents] objectForKey:key];
return [contents objectAtIndex:indexPath.row];
}

- (void) viewDidLoad
{
[super viewDidLoad]
NSMutableArray *keys = [[NSMutableArray alloc] init];
NSString *powerKey = @"Power Settings";

[keys addObject:powerKey];

[contents setObject:[NSArray arrayWithObjects:cellTwo, cellThree, updatePeriodCell, nil] forKey:powerKey];
[self setSectionKeys:keys];
[self setSectionContents:contents];
}

我所有的单元格都是属性。

有什么建议吗?

最佳答案

解决方案非常简单 - 在 UITableView 之上有另一个 View

关于objective-c - 按下自定义单元格文本标签时,didSelectRowAt Index 不会触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10530796/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com