Deep Copying (Bug Fix)

A few months ago I wrote a short piece on creating deep mutable copies of plist data structures. Today, a (modestly anonymous) reader was kind enough to write in with a bug fix, which I would like to share with you.


Briefly, the problem was that my code contained no provision for handling NSNull objects, which represent nil values in collections. The reader provided the following code to fill this gap:

@interface NSNull (DeepMutableCopy)

- (id)deepMutableCopy;


@implementation NSNull (DeepMutableCopy)

- (id)deepMutableCopy
    return self;


(Note that NSNull is a singleton.)


You can download complete, updated header and implementation files, if you’d like. Thanks for reading.

Share and Enjoy:
  • Twitter
  • Facebook
  • Digg
  • Reddit
  • HackerNews
  • Google Bookmarks
  • Slashdot
This entry was posted in iPhone. Bookmark the permalink.

Comments are closed.