2012-03-29 9 views
0

私は、iOS 4.3以上で正常に動作するAVPlayerを持っています。私はそれがiOSの4.2上で動作するように取得しようとすると、これはdeallocを後に起こる:内部KVOを削除する前にAVPlayerを解放しますか?

An instance 0x69c3b0 of class AVPlayer was deallocated while key value observers were still registered with it. Observation info was leaked, and may even become mistakenly attached to some other object. Set a breakpoint on NSKVODeallocateBreak to stop here in the debugger. Here's the current observation info: 
    <NSKeyValueObservationInfo 0x42626d0> (
    <NSKeyValueObservance 0x69f480: Observer: 0x666b20, Key path: currentItem.nonForcedSubtitleDisplayEnabled, Options: <New: NO, Old: NO, Prior: NO> Context: 0x3ea5b558, Property: 0x69f4c0> 

これは大丈夫だろうが、右後、このです:

-[NSKVONotifying_AVPlayer removeObserver:forKeyPath:]: message sent to deallocated instance 0x69c3b0 

私はすべてのことを確認するためにチェック私のオブザーバーは適切に削除され、私はかなり確信しています。 HTTP Live Streaming with AVPlayer in iOS 4.0?

これは内部的に処理しているAVPlayerその何かのように私には見えます、そしてそれは、すでにリリースされています後にオブザーバを削除しようとしている:4.3から4.2への私のコードの唯一の違いは、このです。私は狂っているのですか、これはちょうど4.2のバグでしょうか?

+0

これはおそらくAVPlayerのバグです。また、MPMoviePlayerControllerでも同じことが分かります。 rdar://の時刻。 (まだiOS 5.1にあります) – steipete

答えて

0

コードを再確認してください。観察者がまだのために登録されているように見えます:XCodeの4に助言し、メモリ内のオブジェクトを検査として

currentItem.nonForcedSubtitleDisplayEnabled

あなたはブレークポイントを設定することができます。

+0

私は決してその値のオブザーバーを設定しませんでした。私がやっている唯一のKVOは、player.currentItemの "status"プロパティです。deallocでそのオブザーバを削除します。 –

+0

deallocメソッドを投稿してください! – Sam

関連する問題