iOS : NSInteger and NSUInteger comparison
问题 Surprise! I've a variable like this, NSInteger index = 0; I'm comparing it with one of subviews count (which returns NSUInteger ) like this, if((index-1) <= [[currentmonth subviews] count]) { NSLog(@"true"); } else { NSLog(@"false"); } This always giving false. but If I'll do like this, if ((index-1) <= 42) { NSLog(@"true"); } else { NSLog(@"false"); } This always giving true. I feel that, this because we can't compare NSInteger with NSUInteger correct? I caught this issue, when I have a