title: Programmatically loading an object model created using NSCoding
body: <p>Version 1.0 of an application has a data model, which is saved/loaded using the NSKeyed(Un)Archiver classes, as all model classes adhere to the NSCoding protocol. Say the following hierarchy exists:</p>
  
  <pre><code>-&gt; Houses (NSMutableArray)
  -&gt; -&gt; House (Custom Object)
  -&gt; -&gt; -&gt; Color (3 ints, RGB)
  -&gt; -&gt; -&gt; Number of Residents (int)
  </code></pre>
  
  <p>Say that there are legacy files stored in such a manner, but need to be loaded into version 2.0 of the application for backwards compatibility, using the following newer data model:</p>
  
  <pre><code>-&gt; Neighborhood (Maintains NSMutableArray, among other properties)
  -&gt; -&gt; TownHouse
  -&gt; -&gt; -&gt; Color (3 ints, RGB)
  -&gt; -&gt; -&gt; Occupants (NSMutableArray)
  -&gt; -&gt; (Other types of houses)
  </code></pre>
  
  <p>Obviously, some data will be missing and will need to be filled in. Eg. a basic "Occupant" object will need to be created for each of the "number of residents" that existed before. What I'm looking for is a way to programmatically load in the previous data model, especially if I only have a list of the classes/hierarchy, and not the .m/.h files themselves.</p>
  
  <p>So what I want to do is (assuming I have a file Houses.data, which was serialized using the Houses array):<br></p>
  
  <pre><code>NSFile *legacyFile;
  Neighborhood *hood = [Neighborhood neighborhoodFromLegacyFile:legacyFile];
  </code></pre>
  
  <p>Any ideas?</p>