Does anyone know why…
Items is an allocated and initialised NSArray* with zero items inside it
for (int i = 0;i < [Items count];i++){
// WORK FINE DOES NOT ENTER
}
for (int i = 0;i <= [Items count]-1;i++){
// ENTERS INCORRECTLY!!!
}
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.
Count is declared as
- (NSUInteger)count, so it returns an unsigned integer (or long on 64 bit), and0 - 1becomesNSUIntegerMaxwhich on 32 bit is 4billion and a bit (and on 64 bit a much much larger number).