i currently focus the following problem:
i start an animation, where 2 objects-attributes are triggered.
the code is:
[UIView animateWithDuration:0.3 animations:^{
greyscaleImage.alpha = 1;
activityIndicator.alpha = 1;
} completion:^(BOOL f){
if(f)
{
[activityIndicator startAnimating];
}
}];
which works fine.
the only problem i discovered is, that i have a 0.3 seconds change to crash the app when the view which holds this activityIndicator and greyscaleImage is deallocated.
To make it more clear please imagine a ViewController, its view presented via default iOS-modal-View ways. Now trigger that animation, which takes 2 minutes. before reaching that 2 minutes, you find that animation is quite boring and you want to dismiss that view. now, that the view, activityIndicator and greyscaleImage are released, the animation o/c cannot know what to do.
so i wonder, what to do here + why the debugger points to
} completion:^(BOOL f){
instead of e.g. [activityIndicator ...
is there a way, to allow user to dismiss the view before the 2 minutes are over?
Best Regards
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…