Concatenation of two arrays in Objective-C

前端 未结 3 1473
我在风中等你
我在风中等你 2021-02-06 21:42

How to concatenate two arrays into a single array in Objective-C?

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-06 22:00

    NSArray* newArray = [firstArray arrayByAddingObjectsFromArray:secondArray];
    

    Or using mutable array version just add to it all objects from another array:

    [myMutableArray addObjectsFromArray:secondArray];
    

提交回复
热议问题