title: How to unarchive data with unarchivedObjectOfClass:fromData:error:?
body: <p>I am using <code>unarchiveObjectWithData</code> to unarchive data from <code>NSUserDefaults</code> and it is working good, but it was deprecated in iOS 12.0.
  Xcode suggests to use <code>unarchivedObjectOfClass:fromData:error:</code>, but this method does not work.</p>
  
  <p>I have an array of objects of my class to unarchive.</p>
  
  <p>I have tried to use <code>unarchivedObjectOfClass:fromData:error:</code>, also <code>unarchivedObjectOfClasses:fromData:error:</code> with all classes (NSArray, NSString, MYCLASS..)</p>
  
  <p>Works</p>
  
  <pre><code>NSArray *stored = [NSKeyedUnarchiver unarchiveObjectWithData:data];
  </code></pre>
  
  <p>Does not:</p>
  
  <pre><code>NSArray *stored = [NSKeyedUnarchiver unarchivedObjectOfClass:[MYCLASS class] fromData:data error:&amp;error];
  </code></pre>
  
  <p>I am receiving ”The data couldn’t be read because it isn’t in the correct format.„</p>