Difference between Deep and shallow copy — Hi, I Am Baibhav Singh


First see some Examples: newArary = oldArray isn’t a copy at all. You end up with two pointers pointing to the exact same array. newArray = [NSMutableArray arrayWithArray:oldArray]; is a shallow copy. In 2nd example, does a shallow copy of the array, meaning the individual objects are NOT copied. Shallow Copies: When you create […]

via Difference between Deep and shallow copy — Hi, I Am Baibhav Singh

Advertisements