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

  • Home
  • SEARCH
  • 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 3941576
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:33:34+00:00 2026-05-20T00:33:34+00:00

I am making an iPhone app that will generate something based on quiz answers.

  • 0

I am making an iPhone app that will generate something based on quiz answers. I want the button for the answer to change the question text and sometimes the button label text.

Background Info:

  • ‘a’ is a button
  • ‘questionNumber’ is the question number (duh) and it is why the button will change the texts differently each time it is pressed.

Here is the code I am using:

-(IBAction) a 
{
    questionNumber == 0;

    if(questionNumber == 0) {

        question.text = @"How Much Do You Use Suppressed Weapons?";
    }

    questionNumber == 1;

    if(questionNumber == 1) {

        question.text = @"Do You Like Sleight of Hand?";

        answerA.text = @"Yes";
        answerB.text = @"No";
        [answerC setHidden:YES];
        [answerD setHidden:YES];
        [answerButton3 setHidden:YES];
        [answerButton4 setHidden:YES];
    }
}

and this repeats for the other buttons (b,c, and d). I thought it should work, but it doesn’t do the “do you like sleight of hand” question. It just stays at the how much do you use suppressed weapons question. Please Help! I really want to get into xcoding for the iphone.
BTW, I am not sure that the tags for this question are correct.

Related Question: How can I have an IBAction that has more than two 'if' statements?

  • 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-20T00:33:34+00:00Added an answer on May 20, 2026 at 12:33 am

    Try using a switch statement with breaks.

    switch (questionNumber)
    {
        case 0:
        {
            question.text = @"How Much Do You Use Suppressed Weapons?";
        }
            break;
        case 1:
        {
               question.text = @"Do You Like Sleight of Hand?";
    
               answerA.text = @"Yes";
               answerB.text = @"No";
               [answerC setHidden:YES];
               [answerD setHidden:YES];
               [answerButton3 setHidden:YES];
               [answerButton4 setHidden:YES];
        }
            break;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making an universal openGL based app that should work on ipod/iphone 2G/3G/3GS/4 and
I'm making an iPhone app that has information about different video games. How can
I'm making a universal app that will run on both the ipad and the
I'm making a simple 2D game for the iPhone. It's based on CrashLanding. so
I'm developing an iPhone app that needs to display fairly complex information, and I
Is it possible for an iPhone app to stay dormant while making some kind
Hey, so I'm making an iPhone app and in there is a common function
I'm contemplating making an android version of my iPhone app. One of the attractions
Can anyone tell me the best way to go about making an iPhone application
Making echo of a question around the web: Is the syntax for svn:ignore patterns

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.