В настоящее время у меня есть этот код, который хорошо работает
[UIView setAnimationDidStopSelector:@selector(animationDone:finished:context:)];
- (void)animationDone:(NSString *)animationID finished:(BOOL)finished context:(void *)context {
// do stuff here
}
Вход значения animationID дает мне пустой указатель.
Как я могу передать значение @selector?
Я попробовал
[UIView setAnimationDidStopSelector:@selector(animationDone:@"animation1"finished:context:)];
Это дает мне ошибку.
Спасибо, мишень
] Строка, переданная селектору, является той, которую вы используете при вызове этого метода: [
]. [[UIView beginAnimations:@"your_animation_name_here" context:NULL];
[UIView setAnimationDuration:0.5];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animationFinished:finished:context:)];
// whatever changes here
[UIView commitAnimations];
]
[] После этого можно сделать так: [
] [- (void)animationFinished:(NSString *)animationID finished:(BOOL)finished context:(void *)context
{
if ([animationID isEqualToString:@"your_animation_name_here"])
{
// something done after the animation
}
}
]