无法将值附加到我的 NSArray 变量 [英] Can't append value to my NSArray variable

查看:56
本文介绍了无法将值附加到我的 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

这篇关于无法将值附加到我的 NSArray 变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆