2010-01-04 18 views
6

Şu anda animationID değerini açılıyorKakao setAnimationDidStopSelector

[UIView setAnimationDidStopSelector:@selector(animationDone:finished:context:)]; 

- (void)animationDone:(NSString *)animationID finished:(BOOL)finished context:(void *)context { 
// do stuff here 
} 

çalışıyor bana bir null verir bu kodu var.

Değerleri @selector'a nasıl iletebilirim?

Ben bana bir hata verir

[UIView setAnimationDidStopSelector:@selector(animationDone:@"animation1"finished:context:)]; 

çalıştı.

sayesinde Tee

cevap

16

selektör geçirilen dize bu yöntem çağrısında kullanmak biridir: Daha sonra

[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]; 

, bunu yapabilirsiniz:

- (void)animationFinished:(NSString *)animationID finished:(BOOL)finished context:(void *)context 
{ 
    if ([animationID isEqualToString:@"your_animation_name_here"]) 
    { 
     // something done after the animation 
    } 
} 
+1

bu: [UIView setAnimationDidStopSelector: @selector (animasyonDone: bitmiş: bağlam :)]; bu olmalıdır: [UIView setAnimationDidStopSelector: @selector (animationFinished: bitmiş: contex t :)]; ' –

+0

Yorum için teşekkürler! Düzeltildi. –