2009-09-03 3 views
0

アニメーションを100回繰り返し再生しようとすると、次のコンソールメッセージでiPhone上のアプリケーションが終了します。iPhone上でアニメーションを再生すると "現在のフレームを復元できませんでした"

Program received signal: “0”. 
warning: check_safe_call: could not restore current frame

私はこのクラッシュをどのように取り除くことができますか?アニメーションを使って何か間違っているのですか?コードは次のとおりです。

catAnimationImageView.image = [UIImage imageNamed:@"SZ_Interior_Idle3_0.png"]; 

NSMutableArray *arr = [ [NSMutableArray alloc] initWithCapacity:114]; 
for(int iLoop = 0; iLoop < 114; iLoop++) 
{ 
    [arr addObject:[UIImage imageNamed:[ NSString stringWithFormat:@"SZ_Interior_Idle3_%d.png",iLoop]]]; 
} 
catAnimationImageView.animationImages = arr; 

catAnimationImageView.animationDuration = 10; 
catAnimationImageView.animationRepeatCount = 1; 
catAnimationImageView.alpha = 1; 
[[delegate getMidGroundView] addSubview:catAnimationImageView]; 
[arr release]; 

[catAnimationImageView startAnimating]; 
+0

私は同じ問題を抱えています。それはiPhoneシミュレータでは動作しますが、iPhoneデバイスでは動作しません。 – Raptor

答えて

0
[arr release]; 

あなたはアニメーションを開始する前に画像のあなたの配列をリリースしています。

+0

実際、catAnimationImageView.animationImagesは配列を保持する必要があります。どのようにこれを何度も繰り返しますか?同じコードをもう一度繰り返しますか? – mahboudz

+0

実際には5つの異なる猫のアニメーションがランダムに存在するので、なぜアニメーションの最後にcatanimationImageViewを解放するのですか?異なるアニメーションシーケンスを作成します。 –

+0

catAnimationImageViewを無料でどこに置いても表示されません。最初にスーパービューから削除しますか?あなたは5種類のアニメーションシーケンスのそれぞれに対して100のイメージを持っていますか?合計500枚の画像がありますか?各画像の大きさはどれくらいですか? – mahboudz

関連する問題