title: Why I can't save WKWebView to [NSUserDefaults standardUserDefaults]?
body: <pre><code>NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
  
  [prefs setObject:self.webView forKey:@"webView"];
  </code></pre>
  
  <p>The code above is made to save a WKWebView object but I'm getting a compiler error:</p>
  
  <blockquote>
    <p>2014-11-08 14:58:52.561 Restoration[2431:482391] Property list invalid
    for format: 200 (property lists cannot contain objects of type
    'CFType') 2014-11-08 14:58:52.564 Restoration[2431:482391] Attempt to
    set a non-property-list object > as an
    NSUserDefaults/CFPreferences value for key webView 2014-11-08
    14:58:52.566 Restoration[2431:482391] <strong>* Terminating app due to
    uncaught exception 'NSInvalidArgumentException', reason: 'Attempt to
    insert non-property list object > for key webView'
    *</strong> First throw call stack: (0x2c491c1f 0x39c78c8b 0x2c491b65 0x2c4cbe51 0x2c436599 0x2c4358d7 0x2c4cc0d1 0x2c4cb769 0x2c4ce95b
    0x2c4ce875 0x2d0eab69 0x66bdf 0x2f981c2b 0x2f981bd1 0x2f96c863
    0x2f98163d 0x2f981317 0x2f97abe1 0x2f9513dd 0x2fbc4c29 0x2f94fe39
    0x2c458377 0x2c457787 0x2c455ded 0x2c3a4211 0x2c3a4023 0x3379d0a9
    0x2f9b01d1 0x66ead 0x3a1f8aaf) libc++abi.dylib: terminating with
    uncaught exception of type NSException</p>
  </blockquote>
  
  <p>How can I save the WKWebView and restore it with its history intact?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>8 months have passed and there's no solution to this problem...</p>
  
  <p><strong>EDIT 2:</strong></p>
  
  <p><strong><em>I'm making a web browser</em></strong> and it is crucial when the user restarts the app the web views (tabs) to restore so he can press the back button and go back.</p>
  
  <p>If I save the previous URLs in a simple list I can't put them back into the web view when the app restarts. I can only load the first page. So, the user can't press back because there is no page to back. If it was as simple as saving a list of URLs <em>I wouldn't start a bounty</em>. Since, a web browser is a very complex app I've been very close to the fundamentals of the webViews and I have even submitted 3 bugs from which only 2 have been resolved. Including the infamous <a href="https://stackoverflow.com/questions/26843804/i-cant-capture-the-screenshot-of-a-wkwebview">screenshot bug</a>.</p>
  
  <p>The standardUserDefaults method does work with UIWebView but Apple states that all developers should use the WKWebView following the release of iOS 7. I'm expecting UIWebView to be deprecated in the near future.</p>