NSMutableArray changes to the copy causing changes in the parent NSMutableArray as well

后端 未结 4 464
忘了有多久
忘了有多久 2021-01-24 17:49

I have a NSMutableArray is my delegate that I am using in one of my view controllers as well.

So in viewDidLoad I make a mutable copy of my NSMutableArray like this

4条回答
  •  闹比i
    闹比i (楼主)
    2021-01-24 18:16

    You should do a deepCopy, i use this one and works perfectly, made by Sherm Pendley †.

提交回复
热议问题