Fixed an error on arm64

On the arm64 platform the comparison with NSNotFound will fail, because it's no longer in the range of int