当我记录变量的值时,我有这段简单的代码:
NSLog(@"set.nflag - %@", set.nflag1);
if (set.nflag1 == [NSNumber numberWithInt:1])
{
NSLog(@"set.nflag - %@", set.nflag1);
[sectionArray insertObject:_checkboxCell atIndex:set.nflag1];
}
在最后一行我崩溃了一个日志是:
2013-09-26 11:36:12.537 PharmaTouch[1325:c07] set.nflag - 1 2013-09-26 11:36:12.537 PharmaTouch[1325:c07] set.nflag - 1 2013-09-26 11:36:12.538 PharmaTouch[1325:c07] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM insertObject:atIndex:]: index 127347632 beyond bounds for empty array'
什么可能导致价值改变
设置.nflag1
?