2013-12-11 111 views
0
UITapGestureRecognizer *tapGesture1 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(openNewView:)]; 
UITapGestureRecognizer *tapGesture2 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(openNewView:)]; 
[writeReview_view setTag:1]; 
[map_view setTag:2]; 
[writeReview_view addGestureRecognizer:tapGesture1]; 
[map_view addGestureRecognizer:tapGesture2]; 


    -(void)openNewView:(UITapGestureRecognizer *)recog1 
    { 

      NSLog(@"recog1.view.tag == %d",recog1.view.tag); 
      if (recog1.view.tag==2) 
      { 
       [self performSegueWithIdentifier:@"mapsegue" sender:self]; 
      } 
      else 
      { 
       [self performSegueWithIdentifier:@"loginsegue" sender:self]; 
      } 
    } 

回答

0

在標籤上啓用userInteractionEnabled

label.userInteractionEnabled = YES;