So, shortly after I posted my last message, I noticed it only partially worked (not when closing Xcode). Sorry about that.
The real solution for me was to change it globally (with 10.8) which is what I really wanted anyways:
1) Open the Settings app.
2) Open the General panel.
3) Check "Ask to keep changes when closing documents"
Hope this helps!
I noticed that even after you check the "Ask to keep changes when closing documents" the file modified date has changed right after you click the close button and reverted back after you clicked the revert changes. I have proven this by canceling my editing on my Dropbox' file, it create many revisions for something that supposed to not changed.
This behavior is unacceptable and somewhat irritating. XCode (and maybe all other Apple app) actually & aggressively save the changes and only revert it back if you click the Revert Changes button. Clicking Cancel button also did not work as it should. It save and close the window just like you click Save button.
Why not just simply don't touch the file unless user hit the save button like it used to.
Why Mr. Craig Federigh, why?
The suggest solution isn't working for me.
I have selected "Ask to keep changes when closing documents" in System Preferences / General.
I open an Xcode project, I make a change, I build and run to see the effect, I close the project (not wanting this temporary change to save), and I am not asked whether to save my changes. If I reopen the project, I see the change was saved.
If I make a change and do not build/run, I *am* asked whether I want to save changes upon closing the project.
Building requires the file to be saved. You cannot build the project with the changes without saving first, so Xcode implicitly saves your files when you click build (think of it as Save and Build). So essentially there were no changes to save upon closing the project; they were saved already.
It may not be what you want, but this is the current behavior. Just be aware of it.
This is code work....where revisions are routinely tracked (you do use source control of some ilk, right?) and it's assumed you want to do what you do.
This isn't PaintWorks Deluxe Home Edition Pro, where an application insists on asking if you're really sure about being sure you're sure that you're sure you want to do anything ever without a minder making sure you really want what you just said you want...for sure.
That makes no sense, because saving is the safer option. It only needs to ask once (especially if, as you suggest, you have old revisions in source control).
But the source-control argument is flawed, if for no other reason than that its integration in Xcode is wholly unreliable. Anyone who relies on its GUI for source-control operations or status is really asking for trouble. And this is with simple projects in a single-user environment.
Second, it is a cross-platform standard in applications of all types and expertise levels to ask whether you want to save unsaved changes when you try to quit the app without doing so. Continuing to try to find excuses for not doing so is infantile and pointless.
K T wrote:
…This isn't PaintWorks Deluxe Home Edition Pro…
…You still seem to be reacting as if you're using a broad market consumer-level application…
…The sooner the light goes on that to use it means to have your feet under you…
Dear @KT, please note: https://discussions.apple.com/static/apple/tutorial/etiquette.html
- Be polite, constructive, and stay on topic.
If you close the project without building it, and followed my previous answer to the original poster's question of enabling "Ask to keep changes when closing documents" in System Preferences, then you will be asked to save.
My last post was in regard to the implicit save if one starts a build. If you start a build, it will automatically save your changes; regardless of the system preference. Desirable or not, that is the current functionality. Building the code currently in the editor requires the saving; since other background processes are involved in building.