title: Using NSPersistentDocument to create 'Documents'
body: <p>I would like to create an app that uses </p>
  
  <ul>
  <li>Swift</li>
  <li>CoreData</li>
  <li>'Documents' which work in the standard macOS fashion [custom extension, a single 'file'/filewrapper containing all data relating to that document]</li>
  </ul>
  
  <p>This does not appear possible. The documentation states very clearly that </p>
  
  <blockquote>
    <p>NSPersistentDocument does not support some document behaviors:
    File wrappers. [..]</p>
  </blockquote>
  
  <p>which makes me think that the usual ways of dealing with images in CoreData - <em>binary data with 'allow external storage</em>' and <em>save them to a different location, store the URL in the database</em>  - cannot be used with NSPersistentDocument. I want my users to be able to do the usual Finder operations on my 'file' (duplicate, move to external storage, restore from external backup) and need all my data to be in one single package.</p>
  
  <p>The SQL version of the file store results in the usual three-fold stack when saving - .sqlite, .sqlite-shm, .sqlite-wal - which is useless as a 'document'. </p>
  
  <p>Is there a solution I have overlooked? (examples are very sparse; the <a href="https://github.com/bignerdranch/cocoa-programming-for-osx-5e" rel="noreferrer">Big Nerd Ranch sample</a> does not solve this, either; neither Marcus Zarra nor Objc.io touch on NSPersistentDocument). </p>