-(void) setupAVPlayerForURL:(NSString *)url
{
[appdelegate.sharedplayer stop];
appdelegate.sharedplayer=[[AVAudioPlayer alloc] initWithContentsOfURL:url1 error:NULL];
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
[[AVAudioSession sharedInstance] setActive: YES error: nil];
[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
[appdelegate.sharedplayer setVolume:appdelegate.volumeDelegate];
[appdelegate.sharedplayer play];
self.seekBarSlider.minimumValue = 0.0f;
self.seekBarSlider.maximumValue = appdelegate.sharedplayer.duration;
self.isPlaying=YES;
appdelegate.sharedplayer.delegate=self;
[self loadAlbumArt];
[appdelegate.sharedplayer addObserver:self forKeyPath:@"status" options:0 context:nil];
}
初めてこのアプリを実行するときはいつでもこのログ メッセージが表示されますが、アプリはクラッシュしていません
An instance 0xc1693d0 of class AVAudioPlayer 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.
現在の観測情報は次のとおりです。
<NSKeyValueObservationInfo 0xc194d90> (
<NSKeyValueObservance 0xc194e40: Observer: 0xc1697d0, Key path:
status, Options: <New: NO, Old: NO, Prior: NO> Context: 0x0,
Property: 0xc194d70> )
私が間違っていることは何ですか??