Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 不同地点_Objective C_Xcode_Uigesturerecognizer_Uitouch - Fatal编程技术网

Objective c 不同地点

Objective c 不同地点,objective-c,xcode,uigesturerecognizer,uitouch,Objective C,Xcode,Uigesturerecognizer,Uitouch,嗨 如何定位这两个点?他只给了我一个 -(void)gestureLoad { //GESTURE UIGestureRecognizer *recognizer; recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(numTap2:)]; [(UITapGestureRecognizer *)recognizer setNumberOfTouchesRequired:2];

嗨 如何定位这两个点?他只给了我一个

-(void)gestureLoad {

//GESTURE

UIGestureRecognizer *recognizer;


recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(numTap2:)];
[(UITapGestureRecognizer *)recognizer setNumberOfTouchesRequired:2];
[self.view addGestureRecognizer:recognizer];
self.tapRecognizer = (UITapGestureRecognizer *)recognizer;
recognizer.delegate = self;
[recognizer release];
}

- (void)numTap2:(UITapGestureRecognizer *)recognizer {


CGPoint location = [recognizer locationInView:self.view];


...other actions...
}

非常感谢

根据-[UIgestureRecognitor NumberofTouchs]的描述:

使用此函数返回的值 方法,您可以请求 使用 触摸的位置:查看:方法


因此,调用-locationOfTouch:inView:for each touch以获得相应的位置。

感谢您的回复,我尝试使用它,但我不太清楚如何使用它-(CGPoint)locationOfTouch:(NSUInteger)touchinew:(UIView*)view{……}