私は次のコードを持っています:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerWillEnterFullscreen:)
name:MPMoviePlayerWillEnterFullscreenNotification
object:nil];
メソッドは self のプロパティを使用します。
- (void)moviePlayerWillEnterFullscreen:(NSNotification *)notification
{
NSLog(@"%@", self.videoItem._id);
}
場合によっては (常にではありません)、ハンドラー内の self オブジェクトが別のオブジェクト (およびクラッシュの原因となる初期化されていないオブジェクト) です。
何が間違っているのか、このケースを回避する方法がわかりません。オブジェクトは"self"コピーされますか?