ios:点击tableView中的一个按钮,确定cell所在的行
2015-12-30 22:19
531 查看
在设置的button的selector的方法中如下设置:
- (void)button:(id)sender {
UITableViewCell * cell = (UITableViewCell *)[[sender superview] superview];
NSIndexPath * path = [self.tableView indexPathForCell:cell];
NSLog(@"index row%d", [path row]);
}
- (void)button:(id)sender;方法是我设置的button的selector
- (void)button:(id)sender {
UITableViewCell * cell = (UITableViewCell *)[[sender superview] superview];
NSIndexPath * path = [self.tableView indexPathForCell:cell];
NSLog(@"index row%d", [path row]);
}
- (void)button:(id)sender;方法是我设置的button的selector
相关文章推荐
- OC类和对象基本知识
- ios控制器的生命周期
- IOS7 自定义手势返回 interactivePopGestureRecognizer
- iOS开发中KVC、KVO简介
- iOS 动画开发之Core Animation
- iOS 宏定义的使用与规范
- 12月30号 iOS程序准备
- iOS 编码的一些规范
- iOS开发上传头像
- IAP - 3
- iOS开发之NSURLSession详解
- IAP - 2
- iOS Masonry使用注意篇
- iOS开发中new与alloc的区别
- iOS 图片处理方法(按比例缩放,指定宽度按比例缩放)
- iOS label的换行符\n
- ios开发scrollView中contentSize、contentInset和contentOffset区别
- iOS准备程序
- iOS NSUserDefaults 简介,使用 NSUserDefaults 存储自定义对象
- [转]iOS 中字典与json格式的互相转换