#iOS开发# Attempted to dereference an invalid ObjC Object or send it an unrecognized selector.

2018-12-19 19:02:19

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];

当前页面是本站的「Baidu MIP」版。发表评论请点击:完整版 »