如何将 NSMutableArray 添加到 NSMutableArray Objective-c
我正在从 Java 切换到 Objective-c,但遇到了一些困难。我已经搜索过这个问题但没有取得太大成功。
我有一个存储 NSMutableArrays 的 NSMutableArray。如何向数组添加数组?
I am making the switch from Java to Objective-c, and I'm having some difficulty. I have searched this problem this without much success.
I have an NSMutableArray that stores NSMutableArrays. How do I add an array to the array?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以在数组中存储对另一个数组(或任何类型的对象)的引用:
或者连接数组。
两者都记录在 文档< /a>.
You can either store a reference to another array (or any type of object) in your array:
Or concatenate the arrays.
Both of which are documented in the documentation.
由于数组只是一个像其他对象一样的对象:
或者如果您想连接它们:
Since an array is just an object like any other:
Or if you want to concatenate them:
您可以像添加任何其他对象一样添加它。
You add it like any other object.
如果您添加相同的 NSMutableArray 对象,例如
In case if you add the same NSMutableArray Object, Like
[YourArray addObjectsFromArray:OtherArray];
[YourArray addObjectsFromArray:OtherArray];