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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:15:45+00:00 2026-06-01T06:15:45+00:00

Example I: if (textField.text = @0, @1, @2, @3, @4, @5, @6, @7, @8,

  • 0

Example I:

if (textField.text = @"0", @"1", @"2", @"3", @"4", @"5", @"6", @"7", @"8", @"9", @"10") { label.text = @"0"; }
if (textField.text = @"11", @"12", @"13", @"14", @"15", @"16") { label.text = @"10"; }
if (textField.text = @"17", @"18", @"19", @"20", @"21", @"22") { label.text = @"20"; }
if (textField.text = @"23", @"24", @"25", @"26", @"27", @"28") { label.text = @"30"; }

As you can see below, I have a UIStepper that adds in a text field one by one, but here is what I want to do with the label: Once I get to eleven every six steps up the label will add 10 points (Example I).

But I’m pretty sure I’ve done a terrible job, Can someone help me?

  • 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-01T06:15:47+00:00Added an answer on June 1, 2026 at 6:15 am

    Use this:

    int value = [textfield.text intValue];
    

    then do your value checking with integer numbers. You could use modulo or any other arithmetic then. To return it to a string do this:

    label1.text = [NSString stringWithFormat:@"%d",value];
    

    If your textfield contains integer values then textfield.text (an nsstring) can become an integer using the int value above. Afterwards, it’s easy to check in which case the value is. The simplest is using ifs like this:

     if (value <=10) {
      label.text = @"0";
     } else {
       if ( value > 10 && value <=16 ) {
        label.text = @"10";
       } else { if ( value > 16 and value <= 22) {
          label.text = @"20";
         } 
       }
     }
    

    and so on. As I said, it’s the simplest if..else construct and comparison.

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

Sidebar

Related Questions

for example, I have a textfield, that records the user name, after I click
iam developing one application.In that i use the label and textfield in same line.Every
I have a textfield which takes in full name example: michael peter johnson in
Example: I have an class that inherits from UIImageView. An object creates an instance
I'm curious to see if anyone can shed some light on some strange text
I have a very simple voting form. It contains a single text field for
I had a little but unpleasant problem with symfony2 Field component. For example, I
I have a birth_date field that is stored as a datetime value. The default
i have a textfield: <input type=text id=modname /> and a div: <div id=tuner> <tr>
for example, I want the textfield input number only. my idea is when the

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.