Ios copies a brand new array from the bottom.

Deep copy is only a copy of the outer layer. I need an array element that is exactly the same as the old array, but the element addresses of all child elements and child elements are not the same.
the current idea is to nest and traverse all elements, but I am not familiar with nesting, so I can"t implement it for the time being. Ask God to help me write a method.

Mar.22,2021

official documentation: Apple Documentation on copying collections

according to the documentation, there are several types of deep copies

  1. A convenient way to copy an array is to use the initWithArray:copyItems: method to set copyItems to YES

    NSArray *deepCopyArray=[[NSArray alloc] initWithArray:array copyItems:YES];
  2. use NSKeyedArchiver for archiving, then unfile, and make a deep copy

    NSArray *trueDeepCopyArray = [NSKeyedUnarchiver unarchiveObjectWithData:
              [NSKeyedArchiver archivedDataWithRootObject:oldArray]];
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3ffdd-2c4cf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3ffdd-2c4cf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?