i’d like to save some “workspace” type settings: settings that are tied to the document rather than to the app itself.

things like the selected tab, the sidebar widths, etc.these need to persist even if the user doesn’t save the document — so they’re definitely settings, not document data.

anyone else doing this?

i was hoping there was some hidden corner of NSUserDefaults that handled this, but that doesn’t seem to be the case.

@isaiah YMMV, but we've found from user feedback that (in document-based apps) people generally expect this sort of thing to be saved with the document (they'll temporarily change something, close the file, later reopen, and complain if it wasn't like it was when last saved).

So instead, we make those things part of the document format, but not be undoable (and so don't mark the document as edited, and don't prompt for save on close, etc).

@gregtitus that’s how i have it implemented today. it just feels a bit random when i close the document without saving and it reopens back where it was last time i opened it.

what id really like is something like Xcode where the file is located inside the document bundle, but not actually part of the document model. in other words i’m just sneakily storing it inside the bundle.

but there are about a billion complications with doing that — but it keeps the data with the document, which is nice.