I started a little document based application with a NSOutlineView on the main window. I saved my model in files using NSCoding protocol in the model classes and everything is fine.
Next I wanted to save the user interface (window size and position, expanded items in the outline view, selection, ...) and i found the Resume feature added to Lion.
So I tried to implement it, I added an autosave name to the main window and the outline view, set the autosaveExpandedItems property and implemented the outlineView:itemForPersistentObject: and outlineView:persistentObjectForItem: method in the data source of outline view.
That works but when I create / open an another file then close it, the expanded items state of the others files are set with the state of the closed file.
It's like the app saves only one window for all documents and not one window per document.
I am a bit lost with autosave and resume, is it the same feature or two features completely different ?
Can I use it to save window state or need I to save it in my model ?
Thank you