我有一个子类,AVAudioPlayer
在该子类中我有一个停止当前播放器的方法,并且(出于我不会解释的原因)audioPlayerDidFinishPlaying
像这样手动调用:
// Handles stopping the player and calling audioPlayerDidFinishPlaying
- (void) stopPlayerForTimedRepeat {
// Stop the player
[self stop];
// Manually call the audio player callback
EditPlayListViewController *playlistController = [[EditPlayListViewController alloc] init];
[playlistController audioPlayerDidFinishPlaying:self successfully:YES];
[playlistController release];
}
但是,当我audioPlayerDidFinishPlaying
像这样手动调用时,我原来的所有变量EditPlaylistViewController
都超出了范围。
如何避免这种情况,以便我仍然可以访问所有原始变量?