copy NSArray inside an empty NSArray

后端 未结 2 910
执念已碎
执念已碎 2021-01-16 18:45

I have a first NSArray firstArray and I do

[firstArray removeAllObjects];

after I want fill it with the content of an other a

2条回答
  •  天涯浪人
    2021-01-16 18:59

    Since the firstArray is an NSArray, you will want to do this instead:

    firstArray = [NSArray arrayWithArray:secondArray];
    

提交回复
热议问题