I’m getting the following warning Comparison of unsigned expression < 0 is always false.
I’m not sure how to fix it ?
if(topWindowIndex < 0)
It’s defined as…
NSUInteger topWindowIndex = [allWindows count] - 1;
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.
If
[allWindows count] - 1can never be negative, the test (and the code it controls) is unnecessary. If it can be negative, you should declaretopWindowIndexas a signed type (intorNSInteger).A better solution, IMO, is to store the count directly and use that instead: