NSArray和NSMutableArray之间的区别 [英] Difference between NSArray and NSMutableArray

查看:123
本文介绍了NSArray和NSMutableArray之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么区别b / w NSArray NSMutableArray

What is the difference b/w NSArray and NSMutableArray?

推荐答案

NSMutableArray (以及所有其他类 Mutable in名称)可以修改。因此,如果您创建一个简单的 NSArray ,则以后无法更改其内容(无需重新创建)。但是如果你创建一个 NSMutableArray ,你可以改变它 - 你会注意到它有像 -addObject:这样的方法, -insertObject:atIndex:

NSMutableArray (and all other classes with Mutable in the name) can be modified. So, if you create a plain NSArray, you cannot change its contents later (without recreating it). But if you create an NSMutableArray, you can change it — you'll notice it has methods like -addObject: and -insertObject:atIndex:.

参见文档以获取详细信息。

这篇关于NSArray和NSMutableArray之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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