有没有在代码中添加一些隐藏信息到UITableViewCell的方法?将隐藏信息添加到UITableViewCell
使用案例:
- 在活动供稿,
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
被调用,每个单元都有一个活动。每个都有自己独特的“activityId”。 - 每个细胞都有了其中的一些按钮(具有唯一的标签),并按下时,给定的活动是“喜欢”
- 每个按钮都有一个IBOutlet,那么它会调用模型然后处理像
我对IBOutlet中的代码是:
- (IBAction)buttonUp:(UIButton *)sender {
UIButton *btn = (UIButton *) sender;
UITableViewCell *cell = (UITableViewCell *) [[btn superview] superview];
UIView *cellView = [cell.contentView viewWithTag: ..myUniqueButtonTag.. ];
NSLog(@"activityId is: %@", ...);
}
使用cell.accessibilityValue并为其分配数据..当点击找到该单元格及其accessibilityabilityValue –