我的xib中有一个mapview。
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
NSLog(@"Touch Description %@",[[touch view]description]);
if ([touch view] == self.mapView)
{
//rest of my code
}
}
我得到的描述是
MKAnnotationContainerView:0x19057360; frame =(0 0; 4096 4096); autoresizesSubviews = NO; layer = CALayer:0x1900df20
if循环未执行。我该怎么解决这个问题。请帮帮我。
答案 0 :(得分:0)
-(void) touchesBegan :(NSSet *) touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
NSLog(@"%@",[[touch view]description]);
if ([touch view] == self.mapView)
{
//rest of my code
}
[super touchesBegan:touches withEvent:event ];
}