Hi all,
Do u anyone know that how to set same UITapGestureRecognizer to two labels.....
Actually i did taprecognizer definition in viewdidload method and assign it to two labels....
but that single tap works only for label2..why it was happening??Pls help me guys...
pls see the following code..
///////////////////////////////
-(void )viewDidLoad{
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc]
initWithTarget:self action
selector(handleSingleTap
];
[singleTap setNumberOfTapsRequired:1];
[label1 addGestureRecognizer:singleTap];
[label2 addGestureRecognizer:singleTap];
[singleTap release];
}
- (void)handleSingleTap
UITapGestureRecognizer *)recognizer {
NSLog(@"single tap");
}
}
Thanks in advance...
Do u anyone know that how to set same UITapGestureRecognizer to two labels.....
Actually i did taprecognizer definition in viewdidload method and assign it to two labels....
but that single tap works only for label2..why it was happening??Pls help me guys...
pls see the following code..
///////////////////////////////
-(void )viewDidLoad{
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc]
initWithTarget:self action
[singleTap setNumberOfTapsRequired:1];
[label1 addGestureRecognizer:singleTap];
[label2 addGestureRecognizer:singleTap];
[singleTap release];
}
- (void)handleSingleTap
NSLog(@"single tap");
}
}
Thanks in advance...