Skip navigation

Xcode 4.2 not ask to save changes

3609 Views 28 Replies Latest reply: Aug 4, 2013 8:03 AM by D.McG. RSS
1 2 Previous Next
KAMIKAZE[UA] Calculating status...
Currently Being Moderated
Jan 15, 2012 9:13 AM

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,215 points)
    Currently Being Moderated
    Jan 15, 2012 9:15 AM (in response to KAMIKAZE[UA])
  • Llessur999 Level 4 Level 4 (1,155 points)
    Currently Being Moderated
    Jan 15, 2012 11:17 AM (in response to KAMIKAZE[UA])

    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.

  • Llessur999 Level 4 Level 4 (1,155 points)
    Currently Being Moderated
    Jan 15, 2012 5:19 PM (in response to KAMIKAZE[UA])

    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.

  • Stokestack Level 1 Level 1 (0 points)
    Currently Being Moderated
    Mar 8, 2012 4:07 PM (in response to Llessur999)

    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 (23,905 points)
    Currently Being Moderated
    Mar 8, 2012 7:42 PM (in response to KAMIKAZE[UA])

    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)
    Currently Being Moderated
    Mar 8, 2012 7:44 PM (in response to etresoft)

    Exactly.

  • etresoft Level 7 Level 7 (23,905 points)
    Currently Being Moderated
    Mar 9, 2012 6:57 AM (in response to KAMIKAZE[UA])

    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?

  • etresoft Level 7 Level 7 (23,905 points)
    Currently Being Moderated
    Mar 9, 2012 9:12 AM (in response to KAMIKAZE[UA])

    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,215 points)
    Currently Being Moderated
    Mar 9, 2012 10:19 AM (in response to KAMIKAZE[UA])

    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. Calculating status...
    Currently Being Moderated
    Nov 29, 2012 9:26 AM (in response to KAMIKAZE[UA])

    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

1 2 Previous Next

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.