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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:40:07+00:00 2026-06-12T11:40:07+00:00

I have built an app where the user can press a button and get

  • 0

I have built an app where the user can press a button and get a number of text responses on each tap. After 10 responses, the button runs out of things to say, so I have a reset button placed so that the user can tap it and run the button method again. At this point I am just having trouble figuring out a method to do the reset.

@implementation ViewController
@synthesize billLabel, topLabel, bill;

 - (void)viewDidLoad
{
[super viewDidLoad];

[bill setHidden:YES];

}

 - (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

- (IBAction)button:(id)sender
{
[bill setHidden:NO];
static int counter;

if (counter == 0)
{
    billLabel.text = @"text";
}
else if (counter == 1)
{
    billLabel.text = @"text2";
}
else if (counter == 2)
{
    billLabel.text = @"text3";
}
else if (counter == 3)
{
    billLabel.text = @"text4";
}
else if (counter == 4)
{
    billLabel.text = @"text5";
}
else if (counter == 5)
{
    billLabel.text = @"text6";
}
else if (counter == 6)
{
    billLabel.text = @"text7";
}
else if (counter == 7)
{
    billLabel.text = @"text8";
}
else if (counter == 8)
{
    billLabel.text = @"text9";
}
else if (counter == 9)
{
    billLabel.text = @"text10";
}
else if (counter == 10)
{
    billLabel.text = nil;
}

counter += 1;

}

- (IBAction)reset:(id)sender
{

}

@end
  • 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-12T11:40:08+00:00Added an answer on June 12, 2026 at 11:40 am

    Although your question is a little confusing, I believe I know what you are to do. Make your int counter a class level variable first. Be sure to declare it as 0 at that point. Then, in your reset method simply use this code,

    counter = 0;

    You may want to then disable the button, but that’s up to you.

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

Sidebar

Related Questions

I have built an app that stores dates entered by the user in an
I have an app where the user can choose an image either from the
I have built a free app and a paid app. When user upgrades or
Hi I have a an android app built with PhoneGap. So, the user interface
I have a News Webserver where registered user can get RSS News. I want
I have an app built using Visual Studio 2005, which can run rpt files.
I have an app where the user can create a new project and search
I'm trying to build a small testing app with erlang+mnesia. I have a user
I have built an app that plays lots of sounds the easy way: AudioServicesPlaySystemSound(someSoundID);
I have built an app that works only when not run as a Windows

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.