Sunday, October 11, 2009

iPhone dev Stupidity 34: NSUInteger

NSArray.count is NSUInteger.

Which means for code:

texels_.count <= -1

It's a unsigned int comparison: -1 will be converted to a 0xFFFFFFFF and the result is TRUE.


The ugly thing about this promotion is that there's no any warning.


No comments: