[英]NSRangeException with NSArray objectAtIndex, index beyond bounds
谁能告诉我以下错误在iOS Objective-C中的含义:
Terminating app due to uncaught exception 'NSRangeException', reason: '-[NSCFArray objectAtIndex:]: index (13) beyond bounds (13)'
It means that your index is not within the valid range for your array. 这意味着您的索引不在数组的有效范围内。 Your array has 13 elements and you are trying to access the 14th element. 您的数组有13个元素,并且您正在尝试访问第14个元素。 In C, indexes start at 0, so arrays have indexes that are valid from 0 to length - 1. 在C语言中,索引从0开始,因此数组具有从0到长度-1的有效索引。
This is typically caused by an off by one error . 这通常是由一个错误关闭引起的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.