iOS开发# Attempted to dereference an invalid ObjC Object or send it an unrecognized selector.
出问题的过程
对于数组进行操作时Crash
控制台PO打印 Error
![#iOS开发# Attempted to dereference an invalid ObjC Object or send it an unrecognized selector. #iOS开发# Attempted to dereference an invalid ObjC Object or send it an unrecognized selector.](https://www.yiem.net/usr/uploads/2018/12/152534494.png)
error: Execution was interrupted, reason: Attempted to dereference an invalid ObjC Object or send it an unrecognized selector.
Crash控制台打印 Error
![WX20181219-190146@2x.png WX20181219-190146@2x.png](https://www.yiem.net/usr/uploads/2018/12/2298764715.png)
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI addObject:]: unrecognized selector sent to instance 0x600002fd26d0'
解决方法
对于需要操作的数组使用MutableCopy
self.selectArr = [self.selectArrSup mutableCopy];
![#iOS开发# Attempted to dereference an invalid ObjC Object or send it an unrecognized selector. #iOS开发# Attempted to dereference an invalid ObjC Object or send it an unrecognized selector.](https://www.yiem.net/usr/uploads/2018/12/3068600632.png)