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 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 currently making a whimsical iPhone app that will allow you to change your
I'm making an universal openGL based app that should work on ipod/iphone 2G/3G/3GS/4 and
I am making a simple iPhone app that will basically be an editor. As
im making a iphone app so that any text in the detailTextlabel will fit
I'm making an app that behaves something like the default Messages.app in iPhone where
I will be making an iPhone app that will sell ebooks. we have a
I am making an iPhone app that is designed for things that will be
I'm making an iPhone app that has information about different video games. How can
I am making a iPhone app that has two different targets. They use the
I'm currently making an iPhone app that has PDF viewing a crucial part of

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.