* -[__NSArrayM count]:发送到已释放实例 0x5edd5e0 的消息
我遇到了这种类型的异常,它导致我的应用程序崩溃。代码是:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if(section == 0){
return ([billDetials count]+ 1);
}
int rows = ([billers count] + 1);
return rows;
}
[账单计数]对于此声明,我遇到了异常... 这里 billers 是 NSMutableArray,有 6 个对象。 tableView 由 2 部分组成。
所以我应该得到数组计数为 6 但它没有发生......
最佳答案
听起来 billers 数组没有得到正确保留。确保它是保留的属性,或者在创建该数组时正确保留它。
关于iphone - 数组计数抛出异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4079732/