How much is NSNotFound exactly?
According to this post, it's NSIntegerMax.(Although I can't find on iOS 9.3 on XCode.)
So in 64 bits system, it should be 2^64-1 or 2^63-1? I think it's 2^64-1 but a post said it's 2^63-1, which one correct?
How much is NSNotFound exactly?
According to this post, it's NSIntegerMax.(Although I can't find on iOS 9.3 on XCode.)
So in 64 bits system, it should be 2^64-1 or 2^63-1? I think it's 2^64-1 but a post said it's 2^63-1, which one correct?
It is 2^63-1. In a 64 bit number the least significant bit is 2^0 and the most significant is 2^63 making a total of 64 bits
This is how it's defined in Foundation/NSObjCRunTime.h
:
static const NSInteger NSNotFound = NSIntegerMax;
So on 32-bit devices it's 2^31 - 1
, on 64-bit devices it is 2^63 - 1
. In Swift, you can find the constant as Int.max