Why can't I compare a count of a new array?
Can someone explain this to me ?
if(0 <= -1)
NSLog(@"Thank god");
if([NSArray new].count <= -1)
NSLog(@"What the **** ? %i", [NSArray new].count);
if([[NSArray alloc] init].count <= -1)
NSLog(@"What the **** ? %i", [[NSArray alloc] init].count );
Output is twice What the **** ? 0 and I was expecting no output I expect
to have 0 as count.
If I put the count in a int or log it it ouputs 0 (zero), but the if
statement generates a true on this.
No comments:
Post a Comment