【发布时间】:2012-08-31 02:03:38
【问题描述】:
我正在创建一个使用数组填充的详细信息披露按钮....但是在我的类中没有调用accessoryButtonTappedForRowWithIndexPath: 函数。它是 TableviewDelegate 和 TableviewDatasource 代表。
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath{
NSLog(@"reaching accessoryButtonTappedForRowWithIndexPath:");
[self performSegueWithIdentifier:@"modaltodetails" sender:[self.eventsTable cellForRowAtIndexPath:indexPath]];
}
NSLog 没有打印到控制台,这让我相信函数没有被调用...这当然是当我在单元格上选择时。下面的屏幕截图显示了我如何设置单元格。
【问题讨论】:
-
您确定将数据源和委托连接到适当的类吗?
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath方法是否被调用? -
是 (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 被调用。
标签: ios objective-c uitableview accessoryview