我的應用程序在ARC中。
我在imageView中使用圖像動畫,但經過一段時間後,我的應用程序崩潰,內存不足錯誤。ImageView Animation獲得更多內存
我不是在登錄得到任何錯誤消息,但在檔案工具我得到「內存不足」消息分配部分。我的動畫
一個代碼
ImageView= [[UIImageView alloc] init];
[self.view addSubview:ImageView];
ImageView.frame=CGRectMake(0, 0, 480, 342);
ImageView.animationImages = [NSArray arrayWithObjects:
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"image1" ofType:@"png"]],
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"image2" ofType:@"png"]],
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"image3" ofType:@"png"]],
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"image4" ofType:@"png"]],
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"image5" ofType:@"png"]],
[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"image6" ofType:@"png"]],
nil];
[ImageView setAnimationRepeatCount:1];
ImageView.animationDuration =1.0;
[ImageView startAnimating];
如果我評論這部動畫代碼,然後應用程序正常運行,但我需要在一個視圖中超過5這種類型的動畫。
任何鏈接,教程,任何想法將是很大的幫助......