1

我的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; 帧 = (0 0; 4096 4096); 自动调整子视图 = 否;层=CALayer:0x1900df20

if 循环没有被执行。我该如何解决这个问题。请帮我。

4

1 回答 1

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 ];
    }
于 2012-10-09T04:16:17.050 回答