Merge two arrays while preserving the original array order

后端 未结 3 2035
轮回少年
轮回少年 2021-01-23 06:40

I\'ve writing an application that requests data from an external source (Twitter), which is returned as an ordered array in chronological order:

External array

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-23 07:30

    NSArray *newArray = [externalArray arrayByAddingObjectsFromArray:myArray];
    [myArray release];
    myArray = [newArray mutableCopy];
    

    Any reason not to do this?

提交回复
热议问题