How does Autosave in Mac OS X Lion 10.7 work? How can I change the autosave frequency? [closed]
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
开发者_如何学Python Improve this questionJust curious if anyone has some insight into how Autosave works in Lion? For Applications that have been optimized to take advantage of the Autosave API's - is there a frequency with which the document is "auto saved"? can it be manipulated? where is the autosave data stored? Any insight or details would be appreciated. Thank you!
Lion's Autosave is different from previous versions of autosaving in that it saves directly to the user's file (instead of, for example, a "My Document (Autosaved)" file to the side).
Autosaving happens for a multitude of reasons, only one of which is periodic autosaving. You can influence the autosaving frequency by overriding NSDocumentController's -autosavingDelay
method, but this is mostly just used as a hint on Lion, not a hard requirement.
If you really want to, you can also override NSDocument's -scheduleAutosaving
, but NSDocument has a lot of smarts in that method that you may not override.
There is also the concept of "implicitly cancelable" autosaves, which you can use to cancel a periodic autosave if you think now isn't a good time, for whatever reason.
The Lion AppKit release notes have a lot more info that you'll find useful.
精彩评论