i get a memory leak and crash when using this transition more then 7-8 times:
-(IBAction)pan1:(id)sender{
CATransition *transition = [CATransition animation];
transition.duration = 0.50;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
NSString *types[4] = {kCATransitionFade};
int rnd = random() % 4;
transition.type = types[rnd];
transitioning = YES;
transition.delegate = self;
UIImage *image4 = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"pan_01_cross_0.png" ofType:nil]];
pan_cross_0 = [[UIImageView alloc] initWithImage:image4];
[panView.layer addAnimation:transition forKey:nil];
[panView addSubview:pan_cross_0];
}