参考:http://blog.csdn.net/waiting_49/article/details/49079633
YSCAllViewController *all = [[YSCAllViewController alloc]init];
all.noneArray = arr; //noneArray 与 arr 都为可变数组
all.delegate = self;
[self.navigationController pushViewController:all animated:YES];
在 YSCAllViewController 中打印noneArray 会变成 __NSCFArray,此时需要新建一个新的NSMutableArray 来进行接下来操作,如下:
newMuArray = [NSMutableArray arrayWithCapacity:10];
newMuArray = [NSMutableArray arrayWithArray:noneArray];
这样我们就可以避免了 原本NSMutableArray 在执行 [NSMutableArray remove...]; 等操作的时候造成
2017-01-15 18:00:18.564 Test_UICollectionVIew[1537:43155] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[__NSCFArray removeObjectAtIndex:]: mutating method sent to immutable object'
这样的奔溃问题