Je rencontre un problème étrange avec les blocs d'animation iPhone. Ce code:UIView animateWithDuration: delay: working weird
[UIView animateWithDuration:2 delay: 0 options: 0 animations:
^(void) { [controller setBackgroundColor: [UIColor blueColor]]; }
completion: nil];
[UIView animateWithDuration:2 delay: 2 options: 0 animations:
^(void) { [controller setBackgroundColor: [UIColor redColor]]; }
completion: nil];
met instantanément l'arrière-plan rouge, sans passer l'état bleu. La même chose même pour ce code:
[UIView animateWithDuration:2 delay: 0 options: 0 animations:
^(void) { [controller setBackgroundColor: [UIColor blueColor]]; }
completion:
^(BOOL wrwg) {
[UIView animateWithDuration:2 delay: 2 options: 0 animations:
^(void) { [controller setBackgroundColor: [UIColor redColor]]; }
completion: nil];
}];
C'est, où je tente de lancer la deuxième animation après le premier est terminé. Quel est le problème?
Quel type d'objet est le contrôleur? Un UIView, UILabel, autre? – Anna