I have noticed that when using for loop in objective c, i cant set the loop to go down like:
for(int i=16; i<=1; i-- )
{
NSLog(@"%d",i);
}
He would not print i .
How can i do that anyway ?
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.
Your for statement is incorrect, you check (second part of the for)
i<=1. This defines whileiis smaller or equal to 1 and this should bei>=1: whileiis larger or equal to 1.