I have a mutable array and i would like to arrange it in a nested order upon some criteria.
To achieve this I’d like to move certain elements to mutable arrays of another elements, removing them from the main mutable array, but without releasing them. Actually the question is about removing elements from array without releasing them How do i achieve it?
Thanks
Since you’re moving items from one array to another, it would be easier if you first added the object to the new array and then removed it from the original array.
This is faster than retaining it, removing it from the array, adding it to the new array and then releasing it.