【发布时间】:2011-09-15 20:03:08
【问题描述】:
请原谅我在这方面有点陌生。
我正在尝试检测类似于 MoveMe 示例的触摸——只有我有一个 UIViews (studentCell) 数组放入名为 studentCellArray 的 NSMutableArray 中。
[self.studentCellArray addObject:self.studentCell];
当我有一个触摸时,我想让程序足够聪明,以知道它是否触摸了数组中的任何 UIView 以及它是否需要做一些事情。
这是 touchesBegan: 方法中的代码。
//prep for tap
int ct = [[touches anyObject] tapCount];
NSLog(@"touchesBegan for ClassRoomViewController tap[%i]", ct);
if (ct == 1) {
CGPoint point = [touch locationInView:[touch view]];
for (UIView *studentCard in self.studentCellArray) {
//if I Touch a Card then I grow card...
}
NSLog(@"I am here[%@]", NSStringFromCGPoint(point));
}
我不知道如何访问视图并触摸它们。
【问题讨论】:
标签: uiview uiscrollview touch touchesbegan cgpoint