Ios 使用UISlider的AVAudioplayer控件首次播放时不显示进度

Ios 使用UISlider的AVAudioplayer控件首次播放时不显示进度,ios,objective-c,avaudioplayer,uislider,Ios,Objective C,Avaudioplayer,Uislider,我正在使用Xcode开发一个自定义音频播放器。但问题是,当我第一次加载音频数据滑块时,通过audioplayer.current正确设置滑块.value,进程停止工作 NSError *error2; self.Audioplayer = [[AVAudioPlayer alloc] initWithData:songFile error:&error2]; if (!error2) { Audioplayer.delegate = self; [Audioplayer

我正在使用Xcode开发一个自定义音频播放器。但问题是,当我第一次加载音频数据滑块时,通过
audioplayer.current
正确设置
滑块.value
,进程停止工作

NSError *error2;
self.Audioplayer = [[AVAudioPlayer alloc] initWithData:songFile error:&error2];
if (!error2)
{
    Audioplayer.delegate = self;
    [Audioplayer play];
    self.progressSliderview.value = 0.0f;
    self.progressSliderview.maximumValue = Audioplayer.duration;
    currentTimeUpdateTimer = [NSTimer scheduledTimerWithTimeInterval:0.1
                                                              target:self selector:@selector(updateAudioDisplayplay1)
                                                            userInfo:NULL repeats:YES];
}

Audioplayer.duration是否按预期更新?
updateaudiodisplay1
将此方法的代码放入每次更新中,但滑块值未使用Audioplayer.duration的值首次更新。第一次更新后,将根据audio player.duration值进行更新