当单击快退按钮时,此 UIButton rewind 如何向 UIButton play 发送通知以执行 playpauseaction 方法。
-(void)rewind:(id)sender{
[timer invalidate];
audioPlayer.currentTime = 0;
MainViewController *viewController = [[MainViewController alloc] init];
viewController.view.frame = CGRectMake(0, 0, 320, 480);
[self.view addSubview:viewController.view];
[self.view addSubview:toolbar];
[viewController release];
}
-(void)playpauseAction:(id)sender {
if([audioPlayer isPlaying])
{
[sender setImage:[UIImage imageNamed:@"Play Icon.png"] forState:UIControlStateSelected];
[audioPlayer pause];
[self pauseTimer];
[self pauseLayer:self.view.layer];
}
else
{
[sender setImage:[UIImage imageNamed:@"pause.png"] forState:UIControlStateNormal];
[audioPlayer play];
[self resumeTimer];
[self resumeLayer:self.view.layer];
if(isFirstTime == YES)
{
self.timer = [NSTimer scheduledTimerWithTimeInterval:11.0
target:self
selector:@selector(displayviewsAction:)
userInfo:nil
repeats:NO];
isFirstTime = NO;
}
}
}
单击时倒带按钮执行倒带方法,并向播放按钮发送通知以执行 playpauseAction 方法。
感谢帮助。
编辑 已宣布
@property (nonatomic, retain) UIButton *playButton;
@synthesize playButton = _playButton;
[self playpauseAction:_playButton];
发生的事情是当单击倒带按钮时,它执行播放暂停操作方法,但没有根据 playpauseaction 方法切换播放按钮暂停。这是为什么