无法将值附加到我的 NSArray 变量
问题描述:
我有一个 NSArray,我需要附加一些值,但 array.append 似乎不适用于 NSArray.我可以用什么来像普通数组一样在 NSArray 上附加一些东西
I have a NSArray and i need to append some values but array.append doesn't seems to works on a NSArray. What can i use to append something on a NSArray like a normal array
答
你不能在 NSArray
中添加或追加元素,因为 NSArray
是不可变的.为此你需要取 NSMutableArray
You can not add or append element in NSArray
as NSArray
is immutable.For this you need to take NSMutableArray