温温酱
MyScrollView.h@interfaceMyScrollView:UIScrollView@endMyScrollView.m@implementationMyScrollView-(void)touchesBegan:(NSSet*)toucheswithEvent:(UIEvent*)event{UITouch*touch=touches.anyObject;CGPointtouchLocation=[touchlocationInView:self.window];NSLog(@"%@",NSStringFromCGPoint(touchLocation));}MyViewController.m#importMyScrollView.h-(void)viewDidLoad{MyScrollView*v=[[MyScrollViewalloc]initWithFrame:CGRectMake(0.0f,0.0f,300.0f,300.0f)];v.backgroundColor=[UIColorgrayColor];[self.viewaddSubview:v];}然后看输出:2012-10-1617:53:11.513Demo[3991:c07]{105,143}2012-10-1617:53:12.627Demo[3991:c07]{136,310}2012-10-1617:53:14.519Demo[3991:c07]{277,313}2012-10-1617:53:16.718Demo[3991:c07]{292,312}2012-10-1617:53:17.344Demo[3991:c07]{217,198}2012-10-1617:53:17.776Demo[3991:c07]{152,155}