Previous 1 2 Next 28 Replies Latest reply: Aug 4, 2013 8:03 AM by D.McG.
KAMIKAZE[UA] Level 1 Level 1 (0 points)

Why xcode 4.2 will not ask: "to save changes or not", for example when I delete \ altering anything in the StoryBoard and elsewhere? Wen I close xcode, it's just save any changes I did, but I do not want to do this. That's bad, I can do any modifications in my project and then just hit close button and it's will be saved without any warning messages, but if i do not want to save?


Xcode 4.2, Mac OS X (10.7.1)
  • K T Level 7 Level 7 (23,700 points)
  • Llessur999 Level 4 Level 4 (1,190 points)

    KT is pointing you to the very first first preference, Xcode > Preferences > General > Auto-save, and encouraging you to make use of the documentation to familiarize yourself with Xcode features.

  • KAMIKAZE[UA] Level 1 Level 1 (0 points)

    Hm...?

    Screen Shot 2012-01-16 at 2.21.39.png

  • Llessur999 Level 4 Level 4 (1,190 points)

    Ackkk. You busted me. On Xcode 4.2 for Snow Leopard it looks like this.

    Preferences.png

    Apple must have eliminated this Auto-save setting on the Xcode builds for Lion.  I bet it is tied into the system-wide Lion preferences. I don't know much about Lion auto-save other than the marketing info I have read. Having no control over this would be annoying.

  • KAMIKAZE[UA] Level 1 Level 1 (0 points)

    Yea,  annoying and I can't find option for this, maybe in new Lion and xcode this will be fixed.

  • Stokestack Level 1 Level 1 (0 points)

    Llessur999 wrote:

     

    KT is pointing you to the very first first preference, Xcode > Preferences > General > Auto-save.

    No he isn't.  Those links just go the introductory pages, which say nothing about this.  As usual for him.

     

    There is no preference for this in Xcode, which is probably WHY THIS GUY ASKED.

     

    This situation is a lot worse than simply not asking to save a file.  Lion is deleting work.

     

    Last night I typed a non-trivial paragraph of code into a source file.  And saved it.  I hit Command-S after every line of code, no exaggeration.  A few minutes later, I was scrolling up and down madly looking for it and couldn't find it.  In case I accidentally put it in the wrong file, I searched the whole project for a string I knew I'd used.  Nowhere to be found.

     

    Suddenly Xcode presents a dialog complaining that it couldn't autosave the file because it had been modified externally.  Did I want to "revert", or save what was in the editor?

     

    I've been seeing these dialogs on both my machines intermittently for weeks.  Same versions of everything on each system: OS, dev tools.  Same project.  Usually I opt to save what's in the editor, thinking that it must be the correct version.  Well now I know otherwise.  I hit "Revert", and the block of code magically reappeared on my screen.

     

    No, there was nothing else running that could've deleted code.  At least, not anything visible.

     

    But it occurred to me that this might be Lion file-management crap gone seriously and dangerously wrong.  And now that other people are reporting the same thing, it looks like that suspicion is being borne out.


  • etresoft Level 7 Level 7 (26,605 points)

    Saving files in a development environment is not like it is elsewhere in the operating system. Developers should be using a source control system like git or subversion. If you don't want to save, then revert.

  • Stokestack Level 1 Level 1 (0 points)

    Exactly.

  • KAMIKAZE[UA] Level 1 Level 1 (0 points)

    Lets take Eclipse, Netbeans, delphi or even textedit.

    When we open any file and make some changes then just hit close button, to exit from it, what will happen next?

    Why xcode does not do the same? Not ask: would you like to save?  It just close and save. This is stupid. I've use svn, but this not gonna help. I do not want manually commit every changes i did, becase xcode can just kill it. 

  • etresoft Level 7 Level 7 (26,605 points)

    KAMIKAZE[UA] wrote:

     

    Lets take Eclipse, Netbeans, delphi or even textedit.

    When we open any file and make some changes then just hit close button, to exit from it, what will happen next?

     

     

    I assume Eclipse, Netbeans, and Delphi will interrupt you and ask if you want to save those files. They do this because that is the way Apple designed it years ago and they all copied Apple.

     

    TextEdit in Lion is different. If you haven't ever saved the new file, then you will be prompted to give the file a name and location. If it is an existing file, the the document will just be closed. In a few years, Eclipse, Netbeans, and Delphi will likely work the same way.

     

    Why xcode does not do the same? Not ask: would you like to save?  It just close and save.

     

    Because that is the way it is designed.

     

    This is stupid.

     

    That's your opinion. Most developers would never make changes to a file and then close it without saving. Typically, we make some changes and then test it, repeating the process until it all works. At that point, we will commit the working version into a source control system. The problem is that you can't test it without saving it.

     

    If you don't like it, you are free to use any other development system. Unfortunately, there are very few. If Xcode's behaviour were as bad as all that, there would be a market for competition. There isn't. Ergo, you are going to have to live with it.

     

    becase xcode can just kill it. 

     

    What are you talking about?

  • KAMIKAZE[UA] Level 1 Level 1 (0 points)

    etresoft 

    here is the deal to you: open in xcode any your's BIG project and open any "hard" xib file or .m file  and just delete ALL inside of it (command+a -> DEL ), and then click [x]  on xcode project window.  As result, you have cleared your file and xcode even not ask about it, it's just automatically save empty file.

    I wish a simple configured option in xcode - that can set\unset popup dialog that asking what to do with changes, when  we close xcode.

  • etresoft Level 7 Level 7 (26,605 points)

    KAMIKAZE[UA] wrote:

     

    here is the deal to you: open in xcode any your's BIG project and open any "hard" xib file or .m file  and just delete ALL inside of it (command+a -> DEL ), and then click [x]  on xcode project window.  As result, you have cleared your file and xcode even not ask about it, it's just automatically save empty file.

     

    OK. I asked Xcode to do something and it did exactly what I asked. What's wrong with that? Maybe I wanted to start over. If I change my mind, I can always click "Revert".


    I wish a simple configured option in xcode - that can set\unset popup dialog that asking what to do with changes, when  we close xcode.

     

    It is even easier than that. Your changes are saved. No configuration options to setup.

  • K T Level 7 Level 7 (23,700 points)

    From the linked docs - Keep Track of Changes with Source Control...

     

    As always, feel free to use Report a Bug against the tools for any feature requests or enhancements you'd like to see as well.

     

    Note as well, that there is no evidence that Lion's versioning is playing a role in any of what you're seeing/try to do.

  • D.McG. Level 1 Level 1 (10 points)

    This worked for me; to be asked if I want to save changes before closing a document:

     

    1. Close Xcode.

    2. Type the following into Terminal:

     

    defaults write com.apple.dt.Xcode ApplePersistence -bool no

     

    3. Open Xcode.

     

    This technique works for many other applications:

     

    http://hints.macworld.com/article.php?story=20120604101520950

Previous 1 2 Next