NSMutableArray is indexed by zero. However; from docs :
If the index is outside the array (that is, if the index is greater than or equal to the value returned by the counter), an NSRangeException is thrown.
If nothing is stored in the array, access to index 0 will cause the above test to fail and cause an error.
source share