私のアプリケーションはARCにあります。
imageView で画像アニメーションを使用していますが、しばらくするとアプリケーションがメモリ不足エラーでクラッシュしました。
ログにはエラー メッセージが表示されませんが、プロファイル ツールでは割り当て部分 に「メモリ不足」というメッセージが表示されます。
私のアニメーションの1つのコードは
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];
このアニメーション コードにコメントすると、アプリケーションは正しく実行されますが、1 つのビューにこのタイプのアニメーションが 5 つ以上必要です。
リンク、チュートリアル、アイデアは非常に役立ちます...