[objective-c]UITouchからCGPoint取得

UITouchからCGPoint取得

-(CGPoint)getCGPointByUITouch:(UITouch*)t{
    return [t locationInView:self.view.superview];
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
    NSArray*t=[touches allObjects];
    CGPoint tp1=[self getCGPointByUITouch:[t objectAtIndex:0]];
}