J'ai du code qui perturbe les UIViews, un peu comme lorsque vous éditez vos écrans d'accueil iOS.iOS 4.2 Block Animation -> Pourquoi ai-je ces avertissements: - [UIApplication beginIgnoringInteractionEvents] débordement. Ignorer
J'ai les 2 méthodes suivantes pour obtenir cet effet vacillement:
- (void)wobble {
int amountInRadians = (self.tag % 2) == 0 ? 2.0 : -2.0;
containerView.transform = CGAffineTransformRotate(CGAffineTransformIdentity, RADIANS(-amountInRadians));
[UIView animateWithDuration:0.10
delay:0.0
options:(UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse)
animations:^ {
containerView.transform = CGAffineTransformRotate(CGAffineTransformIdentity, RADIANS(amountInRadians));
}
completion:NULL
];
}
- (void)stopWobble {
[UIView animateWithDuration:0.01
delay:0.0
options:(UIViewAnimationOptionBeginFromCurrentState | UIViewAnimationOptionCurveLinear)
animations:^ {
containerView.transform = CGAffineTransformIdentity;
}
completion:NULL
];
}
Quand j'arrête le vacillement, je reçois l'avertissement (à plusieurs reprises):
- [UIApplication beginIgnoringInteractionEvents] trop-plein . Ignorer
alors (plusieurs fois, le nombre correspondant de commencer les):
- [UIApplication endIgnoringInteractionEvents] appelé sans -beginIgnoringInteractionEvents correspondant. Ignorer
Que diable se passe-t-il? Si je commente l'animation stopWobble, c'est bien, mais naturellement mes animations ne s'arrêtent pas. Si je supprime l'option "UIViewAnimationOptionAllowUserInteraction" lorsque je commence l'animation, j'obtiens l'avertissement beginIgnoringInteractionEvents, mais ce n'est pas bon non plus car j'ai besoin d'interagir avec ces vues pendant qu'elles vacillent.
Le comportement fonctionne bien, alors devrais-je simplement ignorer cela? Il me semble que quelque chose que je devrais réparer, si seulement je peux savoir ce qui le cause.
Maintenant nous avons besoin d'un expert pour l'expliquer en détails. :) –
Oui, ça l'a corrigé. Merci Eric! –
Je n'arrive pas à me débarrasser de ces messages. Est-ce que quelqu'un a une idée de quoi et quand ils sont appelés? –