我使用下面的代码来检测物体上的触摸
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
NSArray *allTouches = [touches allObjects];
for (UITouch *touch in allTouches)
{
NSLog(@"TOUCH DETECT");
}
}但不会被触发
欢迎您的评论
发布于 2012-05-04 09:32:04
什么类型的对象?只有UIResponder子类才会调用touchesBegan:withEvent:。
此外,如果是UIView,请确保userInteractionEnabled为YES。
https://stackoverflow.com/questions/10441524
复制相似问题