search

Home  >  Q&A  >  body text

objective-c - iOS中深拷贝和浅拷贝的理解?

怎么理解这个深拷贝和浅拷贝的实现原理?

伊谢尔伦伊谢尔伦2815 days ago454

reply all(3)I'll reply

  • 阿神

    阿神2017-04-28 09:06:27

    http://www.cnblogs.com/ydhliphonedev/archive/2012/04/27/2473927.html
    http://ios.jobbole.com/83183/

    Brother, use Baidu...

    reply
    0
  • PHPz

    PHPz2017-04-28 09:06:27

    Deep copy is a value copy, shallow copy is a pointer copy

    For example, for the cake in the same drawer, when making a deep copy, a new cake is made and saved, and when a shallow copy is made, a key to open the drawer is copied and saved.

    reply
    0
  • 怪我咯

    怪我咯2017-04-28 09:06:27

    Deep copy copies content, while shallow copy copies pointers. The biggest difference between deep copy and shallow copy is whether the address of the subclass object changes. If the address of the subclass object changes, then it is a deep copy

    reply
    0
  • Cancelreply