9
NSNotFound
定义为NSIntegerMax
,其定义为LONG_MAX
。NSNotFound,NSInteger,NSUInteger和NSRange.location
NSRange.location
定义为NSUInteger
。
某些基金会方法返回位置值为NSNotFound
的NSRange
。
所以,一个经常干这种事比较:
if (aRange.location == NSNotFound)
但不是符号和无符号整数之间的比较应该产生一个警告?