CATransition动画有时会崩溃

时间:2012-11-21 07:48:18

标签: iphone ios animation uitableview catransition

我在我的应用程序中使用CATransition动画,它工作正常,但有时会崩溃。

这是我的代码:

-(void)_close_btn_click:(UIButton*)button
{

  NSLog(@"update Button %ld clicked.",(long int)[button tag]);    
  NSInteger intvalue=[[NSString stringWithFormat:@"%ld",(long int)[button tag]]intValue];    
  NSLog(@"delete_index:%d",intvalue);    
  CATransition* transition = [CATransition animation];    
  [transition setDuration:1.0];    
  transition.type = @"rippleEffect";    
  transition.subtype = kCATransitionFromLeft;    
  transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];    

  [cell._slide_view.layer addAnimation:transition forKey:@"push-transition"];    
  CATransition* transition1 = [CATransition animation];    
  [transition1 setDuration:1.0];    
  transition1.type = @"rippleEffect";    
  transition1.subtype = kCATransitionFromLeft;    
  [cell._en_cell_close_btn.layer addAnimation:transition forKey:@"push-transition"];
  cell._slide_view.hidden=YES;    
}

1 个答案:

答案 0 :(得分:1)

我想在您调用此方法之前,您的cell_slide_view可能已取消分配