iOS开发# Attempted to dereference an invalid ObjC Object or send it an unrecognized selector.
出问题的过程
对于数组进行操作时Crash
控制台PO打印 Error
error: Execution was interrupted, reason: Attempted to dereference an invalid ObjC Object or send it an unrecognized selector.
Crash控制台打印 Error
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI addObject:]: unrecognized selector sent to instance 0x600002fd26d0'
解决方法
对于需要操作的数组使用MutableCopy
self.selectArr = [self.selectArrSup mutableCopy];