Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8101487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:59:31+00:00 2026-06-05T22:59:31+00:00

Getting message expected identifier in red for below these two statements } else if

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:59:32+00:00Added an answer on June 5, 2026 at 10:59 pm

    Don’t put square brackets around your conditional tests. The syntax is just else if (playpauseButton.state == UIControlStateSelected).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Getting red warning message that expected identifier for this statement CALayer = ImageView.layer; Using
I'm getting this error message with the code below: class Money { public: Money(float
I am getting an error message, and I not quite sure where the issue
I am getting an error message like so: Linear.hs:215:27: Couldn't match expected type `forall
I am getting this message in unit test expected:<interface java.sql.Connection> but was:<class com.mysql.jdbc.JDBC4Connection> from
if i have a href getJSON is working fine as expected (getting alert message
Hi I am getting the error message error: expected initializer before '<' token every
I'm getting strange error message in Console, but application functions properly. Has anyone else
The below code only seems to POST the 'message' and nothing else. Is there
I'm getting a Message signature was incorrect exception when trying to authenticate with MyOpenID

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.