How to add an NSMutableArray to an NSMutableArray Objective-c

后端 未结 5 1146
[愿得一人]
[愿得一人] 2021-02-12 13:50

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

5条回答
  •  既然无缘
    2021-02-12 14:12

    You can either store a reference to another array (or any type of object) in your array:

    [myArray addObject:otherArray];
    

    Or concatenate the arrays.

    [myArray addObjectsFromArray:otherArray];
    

    Both of which are documented in the documentation.

提交回复
热议问题