Getting message expected identifier in red for below these two statements
} else if ([playpauseButton.state == UIControlStateSelected])
} else if ([playpauseButton.state == UIControlStateNormal])
I m not getting where i m missing identifier in below play/pause/resumeaction
if( playpauseButton.state == UIControlStateNormal ){
[sender setImage:[UIImage imageNamed:@"pause.png"] forState:UIControlStateSelected];
[audioPlayer play];
self.timer = [NSTimer scheduledTimerWithTimeInterval:11.0
target:self
selector:@selector(displayviewsAction:)
userInfo:nil
repeats:NO];
} else if ([playpauseButton.state == UIControlStateSelected])
{
[sender setImage:[UIImage imageNamed:@"Play Icon.png"] forState:UIControlStateNormal];
[audioPlayer pause];
[self pauseTimer];
} else if ([playpauseButton.state == UIControlStateNormal])
{
[sender setImage:[UIImage imageNamed:@"pause.png"] forState:UIControlStateSelected];
[audioPlayer play];
[self resumeTimer];}}
I have programmed this way because i want when play is pressed it should play audio file plus start NSTimer to load view controllers one after another. When pause is pressed it should pause audio file plus NSTimer to avoid further loading of view controllers one after another and finally pause is resumed back to play audio file from the same point it should resume timer to start loading view controllers one after the other from that point.
If any one can help me to solve this.
Appreciate help.
Thanks.
Don’t put square brackets around your conditional tests. The syntax is just
else if (playpauseButton.state == UIControlStateSelected).