concept array element in category ios

This is an excerpt from Manning's book Objective-C Fundamentals.
Notice that to access the sixth element, you specified index 5. That’s because indexes start at 0 and not the more “natural” value of 1. When accessing array elements, the array index need not be specified as a simple constant. You can use any valid expression that results in an integer value. This allows you to write code that accesses different array items based on the state of the application. For example, consider the following code sample, which adds the widths of all 150 boxes:
In this listing you set up a loop
to step through each element in the array. The loop sets the loop counter variable i to the values 0 through [pets count] - 1. In the loop you fetch the array element at index i via the objectAtIndex: method and check to see if it’s equal to the value you are looking for
. If a match is found, you set the found variable to YES
and break out of the for loop immediately, because there’s no need to check any remaining array elements.
to step through each element in the array. The loop sets the loop counter variable i to the values 0 through [pets count] - 1. In the loop you fetch the array element at index i via the objectAtIndex: method and check to see if it’s equal to the value you are looking for
. If a match is found, you set the found variable to YES
and break out of the for loop immediately, because there’s no need to check any remaining array elements.