NSMutableArray - Add array at start

后端 未结 5 1498
逝去的感伤
逝去的感伤 2021-02-05 12:47

It is a simple pull to refresh case. I have data loaded into table and have a mutable data array at back-end, I receive a array of new data and want to add this complete array a

5条回答
  •  一生所求
    2021-02-05 13:31

    Creating a new array is probably your best solution, but you can also use a loop

    NSUInteger index;
    
    index = 0;
    for ( id item in sourceArray )
    {
        [destArray insertObject:item atIndex:index];
        index++;
    }
    

提交回复
热议问题