Serialize struct with pointers to NSData <p>I need to add some kind of archiving functionality to a Objective-C Trie implementation (<a href="http://github.com/nathanday/ndtrie" rel="nofollow noreferrer">NDTrie</a> on github), but I have very little experience with C and it's data structures.</p> <pre><code>struct trieNode { NSUInteger key; NSUInteger count, size; id object; __strong struct trieNode ** children; __strong struct trieNode * parent; }; @interface NDTrie (Private) - (struct trieNode*)root; @end </code></pre> <p>What I need is to create an <code>NSData</code> with the tree structure from that root - or serialize/deserialize the whole tree some other way (conforming to <code>NSCoding</code>?), but I have no clue how to work with <code>NSData</code> and a C struct containing pointers.</p> <p>Performance on deserializing the resulting object would be crucial, as this is an iPhone project and I will need to load it in the background every time the app starts.</p> <p>What would be the best way to achieve this?</p> <p>Thanks!</p>