Fixed an error on arm64

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