Rus*_*edi 9 objective-c uitableview ios
在我的应用程序中,当我第一次运行应用程序时,它工作正常.但是当我再次运行2次,它崩溃了.
这是错误..
NSRangeException',原因:'*** - [__ NSArrayM objectAtIndex:]:索引5超出空数组的边界'


Vij*_*com 18
原因:您正在访问要在索引处访问对象的Empty数组.
替换下面代码中的所有地方
[arrMydata objectAtIndex:indexPath.row];
Run Code Online (Sandbox Code Playgroud)
同
//1. Positive index ([anArray objectAtIndex:-NUMBERS]) will crash
//2. within the array boundary
if([arrMydata count] > 0 && [arrMydata count] > indexPath.row){
shrObj=[arrMydata objectAtIndex:indexPath.row];
}
else{
//Array is empty,handle as you needed
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
28484 次 |
| 最近记录: |