好的,我仍然试图在Objective-C中找到自己的方向,我认为我已经完成了它,但现在我遇到了这种方法。所以有些事情让我感到困惑,如果可能的话,我想详细解释一下。第一行:'UITouch * touch = [touches anyObject];',现在对我的理解anyObject是一个散列表?但是,如何在这种情况下定义它?我不明白的地方时,我知道它是属于NSSet中定义的,但我很困惑,在此背景下,范围...ccTouchesMoved [触及anyObject]混淆?
- (BOOL)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
CGPoint point = [touch locationInView: [touch view]];
point = [[Director sharedDirector] convertCoordinate: point];
NSLog(@"ccTouchesMoved x=%f y=%f", point.x, point.y);
return YES;
}
谢谢,我现在看到它...不知道为什么我认为它是一个散列表... – emalamisura 2009-06-03 15:05:01