Appel d'un événement sur un bouton qui ne se lance pas
Bonjour,
j'ai crée un bouton dans un UIViewController mais l'appel de son action se fait une fois sur 4, voici mon code :
Code:
1 2 3 4 5 6 7 8 9 10
| UIButton * btn_tous = [[UIButton alloc] initWithFrame:CGRectMake(0, offset_y + 1, self.view.frame.size.width, 90)];
btn_tous.userInteractionEnabled = YES;
[btn_tous addTarget:self action:@selector(openCarte) forControlEvents:UIControlEventTouchUpInside];
[btn_tous setBackgroundColor:[UIColor redColor]];
[main.view addSubview:btn_tous];
mainScrollView.contentSize = CGSizeMake(self.view.frame.size.width, 520);
[mainScrollView addSubview:main.view]; |
l'appel se fait aléatoirement lorsque je clique dessus.
Merci d'avance