【发布时间】:2018-01-02 21:12:10
【问题描述】:
我有一段代码崩溃了:
索引 18446744073709551615 超出空数组的范围
我知道应该先检查数组是否为空,但我不确定如何。
NSIndexPath *indexPathSecondLast = [NSIndexPath indexPathForRow:[mArrChatDetails count]-1 inSection:0];
ChatDetail *objChatOnCellSecondLast = [mArrChatDetails objectAtIndex:indexPathSecondLast.row];
有人能指出正确的方向吗?
【问题讨论】:
-
错误信息很清楚:array 是 empty。 0 - 1 是
Int64.max(18446744073709551615)
标签: objective-c arrays