上述错误发生在这一行:
_nextRegionsArray=[[NSMutableArray alloc] init];
[_nextRegionsArray addObject:_geofences_ending_regions[_positionOfRoute]];
这里声明_nextRegionsArray:
@implementation PSLocationManager
{
NSMutableArray *_nextRegionsArray;
}
和geofences_ending_regions是一个包含CLRegions的数组。
为什么我会收到错误:
'NSInvalidArgumentException', reason: '-[__NSArrayM identifier]: unrecognized selector sent to instance 0x9f996a0'
答案 0 :(得分:0)
当要添加的对象为nil时,会导致上述异常。你能核实_geofences_ending_regions[_positionOfRoute]
是不是零吗?