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” ..
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
You missed off a variable reference:
As an optional extra, it looks like
numberstringis anNSStringobject, 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:Also note that the
intValuemethod 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.