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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:07:19+00:00 2026-06-11T13:07:19+00:00

Guys what am I doing wrong? if (numberstring.intValue <=15) { rankLabel.text = @A1; }

  • 0

Guys what am I doing wrong?

if (numberstring.intValue <=15) {
    rankLabel.text = @"A1";
}
else if (numberstring.intValue >16 && <=40){       
    rankLabel.text = @"A2";
}

I get an error on the “<=40” ..

  • 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-11T13:07:20+00:00Added an answer on June 11, 2026 at 1:07 pm

    You missed off a variable reference:

    if (numberstring.intValue <=15) {
        rankLabel.text = @"A1";
    }                                  //        vv here vv
    else if (numberstring.intValue >16 && numberstring.intValue <= 40){       
        rankLabel.text = @"A2";
    }
    

    As an optional extra, it looks like numberstring is an NSString object, which you are repeatedly converting to an integer in order to test various ranges. That operation is quite expensive, so you are better off doing the conversion once:

    int value = [numberstring intValue];
    if (value <=15) {
        rankLabel.text = @"A1";
    }
    else if (value >16 && value <= 40){       
        rankLabel.text = @"A2";
    }
    

    Also note that the intValue method is not a property so I would avoid using the Objective-C 2.0 dot syntax to access it and use the normal method calling mechanism.

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

Sidebar

Related Questions

hey guys, i wonder what i'm doing wrong. index.html <script src=swfobject/swfobject.jstype=text/javascript></script> <div class=post> <script
what am I doing wrong here guys? $string = string How Long is a
Hey Guys...need help. Working on a project and get this error on the Output
Hey guys i dont know what i'm doing wrong here. www.example.com/data/stuff1/stuff2/stuff3 to www.example.com/anything.php?par1=data&&par2=stuff1/stuff2/stuff3 And
Here is my code guys, what am I doing wrong (I am forced to
Hey guys I'm doing this wrong again I'm sure, but I'm trying to instantiate
guys im desperate and i really dont know what i am doing wrong :(
Ok guys, i know i am doing something wrong, but i cannot figure that
Can you guys point out what I am doing wrong on with the navigation
hey guys, what am i doing wrong. i have kind of folders on my

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.