title: How can I decode an object when original class is not available?
body: <p>I have an iOS 7 application that saves a custom object to app's iCloud Docs folder as a file. For this, I make use of NSCoding protocol.</p>
  
  <pre><code>@interface Person : NSObject &lt;NSCoding&gt;
  
      @property (copy, nonatomic) NSString *name
      @property (copy, nonatomic) NSString *lastName
  
  @end
  </code></pre>
  
  <p>Object serialization works perfectly in iOS 7 version of the app:</p>
  
  <ol>
  <li><p><code>initWithCoder</code> and <code>encodeWithCoder</code></p></li>
  <li><p><code>[NSKeyedArchiver archivedDataWithRootObject:person]</code></p></li>
  <li><p><code>person = NSKeyedUnarchiver unarchiveObjectWithData:(NSData *)theData]</code></p></li>
  </ol>
  
  <p>But I need to move this app to iOS 8, and this class will be coded in swift and 'renamed' for this new iOS 8 version of the app.</p>
  
  <pre><code>class PersonOldVersion: NSObject, NSCoding {
      var name = ""
      var lastName = ""
  }
  </code></pre>
  
  <p>When I try to unarchive the object I got the following error:</p>
  
  <pre><code>*** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: '*** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (Person)'
  </code></pre>
  
  <p>I already tried renaming swift class 'PersonOldVersion' to original class name ('Person') but still fails.</p>
  
  <p>How can I decode an object which original class isn't available?</p>