我在我所采取的ImageView作为背景,并在ImageView的我使用89个图像作出animation.Here是我的代码做动画Ipad的动画图像崩溃问题
-(void)viewWillAppear:(BOOL)animated
{
NSString *cachesDirectoryPath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSLog(@"cachesDirectoryPath: %@", cachesDirectoryPath);
CPIAppDelegate *obj=(CPIAppDelegate *)[[UIApplication sharedApplication]delegate];
arrayOfImages=[[NSMutableArray alloc]init];
viewMenu.hidden = obj.buttonStatus;
for (int i=0; i<IMAGE_ANIMATION_COUNT; i++) {
// [UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"%@/streamvideo351_frame%d.jpg",cachesDirectoryPath,i]];
[arrayOfImages addObject:[UIImage imageNamed:[NSString stringWithFormat:@"streamvideo351_frame%d.jpg",i]]];
}
BackGrdImage.animationImages=arrayOfImages;
BackGrdImage.animationDuration =5.0;
BackGrdImage.animationRepeatCount =3;
[BackGrdImage startAnimating];
[arrayOfImages removeAllObjects];
}
和应用在dealloc方法中我使用
[imageAnimations release];
[BackGrdImage removeFromSuperview];
[BackGrdImage release];
它正常工作模拟器上的崩溃,但在Ipad.What在ipad上实际发生的是有时它会闪烁,一段时间一次disappear.So请帮我出这个friends.I我也在-(void)viewWillDisappear
上发布了这个数组e朋友帮助我与它任何帮助或建议将不胜感激。
可能不是问题,但请确保您在viewWillAppear:方法的某个时刻调用[super viewWillAppear:animated]。 – Sam 2011-04-27 06:31:11