ios - 如何检测被触摸的单元格的行

标签 ios xcode uitableview push uitapgesturerecognizer

我的应用程序中有一个 UITableViewController,当然还有一个 UITableView 单元格。我有一个单元格的推送 segue(到另一个 UIViewController)。如何检测被触摸的单元格行?

最佳答案

你可以这样做:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    NSLog(@"Selected row is %d",[[self.tableView indexPathForSelectedRow] row]);
}

关于ios - 如何检测被触摸的单元格的行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26489986/

相关文章:

ios - 如何在tableViewCell中获取准确的星星

ios - Facebook Audience Network 不显示广告图标

iphone - 从 tableviewcontroller 推送时的黑色背景

iphone - 解析 iPhone 项目中的 .ics 数据

ios - 如何删除 UITableView 中的空单元格?

ios - 除了加载行的子集之外,使用 NSFetchedResultsController 有什么好处

ios - UIImageView 在 UIView 层上,错误的帧输出

ios - NSMutableAttributedString:如何在 iOS 上以编程方式删除最后一个字符?

ios - 测试来自 NSMutableArray 的值并显示到 Tableview

ios - 如何在 Storyboard 中使用 UIScrollView