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 6695611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:14:33+00:00 2026-05-26T06:14:33+00:00

In my app I have an ibaction and inside it I have 2 different

  • 0

In my app I have an ibaction and inside it I have 2 different instruction with an “if”

 if (i == 0)  //do instruction set 1
 if (i == 1) //do instruction set 2
 // and everytime I push button i change from 0 to 1 or from 1 to 0

the problem is that if I repeatedly press the button of this IbAction it don’t work fine because the previous ibaction didn’t finish its instruction set1

example = press button, it execute instruction set 1, if I push another time the button it shouldn’t work because it it didn’t finish its work and I want to wait the end of instruction set 1 to repeat the push of button.

Do you understand?

  • 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-05-26T06:14:33+00:00Added an answer on May 26, 2026 at 6:14 am

    Assuming you have BOOL workInProgress variable in your class:

    - (IBAction)action {
        if (!workInProgress) {
            workInProgress = YES;
            if (i == 0) {
                // do something that in the end sets workInProgress to NO
            } else if (i == 1) {
                // do something else that in the end sets workInProgress to NO
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that switches around to about 10 different view controllers with
I have a IBAction which is called via a button in my iPad App.
I have an app that lets the users chose one and only one button
I have an app that have an sendInAppSMS action inside it. It brings up
in my app, I have an IBAction method to change view to a another
I have an app where i have an IBAction which recognizes a tap gesture
I have my app that have some tab's (tabbar). In the first tab, there
I have a couple UIViewControllers that I am trying to access an array inside
I want to open Mail app from my app when the one button in
I have an IBAction that I have connected to a UITextField element in Interface

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.