Je crée 2 UIButton (autre tag) et se connecter à 1 action mais quand la presse en même temps, il se déclenche 2 l'action avec un petit retard.Comment implémenter deux UIButton en même temps?
- (IBAction)keysPress:(UIButton *)sender {
UIButton *butOne = (UIButton *)[sender viewWithTag:0];
UIButton *butTwo = (UIButton *)[sender viewWithTag:1];
NSLog(@"BUT 1: %@ || BUT 2: %@",butOne, butTwo);
}
Déconnectez-vous toujours 2times:
2013-02-19 09:37:40.933 TestActions[1107:c07] BUT 1: <UIButtonLabel: 0xca4d450; frame = (65 67; 9 19); text = 'â'; clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0xca4d4c0>> || BUT 2: <UIRoundedRectButton: 0xca4d310; frame = (161 164; 139 153); opaque = NO; autoresize = RM+BM; tag = 1; layer = <CALayer: 0xca4d270>>
2013-02-19 09:37:40.935 TestActions[1107:c07] BUT 1: <UIRoundedRectButton: 0xca4c5c0; frame = (20 164; 135 153); opaque = NO; autoresize = RM+BM; layer = <CALayer: 0xca4c6b0>> || BUT 2: (null)
Comment contrôler ce cas? 2 Boutons, 1 action - tir 1 fois.
Désolé, Très bonne solution mais je ne comprends pas bientôt. Milles mercis! –