【发布时间】:2019-01-15 11:48:12
【问题描述】:
我是 Objective C 的新手,在使用自定义 UITableViewCell 时遇到问题。
我在自定义 tableviewcell 中使用 touchesBegan,如下所示:
#import "UserListTableViewCell.h"
@implementation UserListTableViewCell
@synthesize userTableViewCellView, cellIndex;
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
... .. ...
}
-(void) touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
... ... ...
}
-(void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
... ... ...
}
然后我不能使用函数 didSelectRowAtIndexPath{}。 即使使用 touchesBegan 方法,我如何使用 TableView 选择。
如果你能解决这个问题,请提前告诉我。
谢谢。
【问题讨论】:
-
你想对
touchesBegan事件做一些额外的事情吗?我认为你可以通过使用didSelectRowAtIndexPath()轻松实现任何你想要的。 -
感谢您的回复。我的意思是 didSelectRowAtIndexPath() 不起作用。有预付款吗?
标签: ios objective-c uitableview