int k = 0;
k = [myArray indexOfObject:_endNode];
I only have a few objects added to the array and _endNode isn’t one of them.
I expect my k value to be -1. But, my k on the second line gives me a value of 21787887.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s actually
NSNotFound, which is defined asNSIntegerMax.This, by the way, is quite explicit in the documentation.