我有这样的代码是与错误*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSArray objectAtIndex:]: index 0 beyond bounds for empty array'
获取NSRangeException超越界限崩溃
在这一行崩溃:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
MyObject *myCode = [self.fetchedResultsController objectAtIndexPath:indexPath];
}
我看不出什么错在这里,它是从一个获取拉低数据。
如果您尝试访问空数组的第一个元素,您不觉得有什么问题吗? –