Manchmal wird die Selektormethode "tagClickAtIndex" nicht aufgerufen.iOS UITapGestureRecognizer funktioniert manchmal nicht
UILabel* label = [[UILabel alloc] init];
label.userInteractionEnabled = YES;
UITapGestureRecognizer* tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tagClickAtIndex:)];
[label addGestureRecognizer:tapGesture];
-(void)tagClickAtIndex:(UITapGestureRecognizer*)gesture
{
NSMutableDictionary *mutDict = [[[NSMutableDictionary alloc]initWithDictionary:[_tagArray objectAtIndex:gesture.view.tag]] mutableCopy];
[mutDict setValue:[NSNumber numberWithLong:gesture.view.tag] forKey:@"index"];
[self.delegate tagClickAtIndex:mutDict];
}
Tushars überprüfen mein Ans wer.It funktioniert einwandfrei. – user3182143