Currently Being ModeratedNov 29, 2012 8:25 PM (in response to KAMIKAZE[UA])
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!
Currently Being ModeratedDec 19, 2012 11:26 PM (in response to D.McG.)
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?
Currently Being ModeratedJul 20, 2013 1:12 PM (in response to D.McG.)
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.
Currently Being ModeratedJul 29, 2013 6:24 PM (in response to startswithj)
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.
Currently Being ModeratedJul 29, 2013 6:29 PM (in response to D.McG.)
So essentially there were no changes to save upon closing the project; they were saved already.
That's not a safe assumption at all. What if you close the project without building it?
Currently Being ModeratedJul 29, 2013 6:34 PM (in response to Stokestack)
I've been using Xcode for over 3 years now and have yet to lose any text I've entered.
And this includes those times when Xcode decides to go belly-up at the worst possible time.
Currently Being ModeratedJul 29, 2013 7:28 PM (in response to Stokestack)
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.
Currently Being ModeratedJul 29, 2013 9:20 PM (in response to K T)
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.
Currently Being ModeratedJul 29, 2013 9:24 PM (in response to Stokestack)
You still seem to be reacting as if you're using a broad market consumer-level application. Xcode is a derived IDE, not some hand-holding text editor. The sooner the light goes on that to use it means to have your feet under you, the sooner you'll be able to relax behind it.
Currently Being ModeratedJul 30, 2013 8:04 AM (in response to K T)
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.
Currently Being ModeratedAug 4, 2013 8:03 AM (in response to Stokestack)
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.