インストルメントでメモリリークを追跡しました。私はいつも、担当ライブラリが Foundation であるという情報に行き着きます。コードでそれを追跡すると、ここに行き着きますが、メモリ管理に問題はありません。
- (void)setupTimer {
// stop timer if still there
[self stopAnimationTimer];
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:0.2 target:self selector:@selector(step:) userInfo:nil repeats:YES];
self.animationTimer = timer; // retain property, -release in -dealloc method
}
プロパティ animationTimer はタイマーを保持しています。-dealloc で -リリースします。
これはフレームワークのバグのように見えますか? iPhone OS 3.0 と 3.1 で確認しましたが、このように NSTimer を使用するたびに、どちらも問題が発生します。他に何が問題になる可能性がありますか?
(私のメモリリークスキャン間隔は0.1秒でしたが、5秒でも同じです)