9
NSNotFound
定義爲NSIntegerMax
,其定義爲LONG_MAX
。NSNotFound,NSInteger,NSUInteger和NSRange.location
NSRange.location
定義爲NSUInteger
。
某些基金會方法返回位置值爲NSNotFound
的NSRange
。
所以,一個經常幹這種事比較:
if (aRange.location == NSNotFound)
但不是符號和無符號整數之間的比較應該產生一個警告?