xcode The document “…” could not be saved

前端 未结 15 2843
谎友^
谎友^ 2021-02-20 00:31

I use xcode 3.2.4 on snow leopard. Today when I tried to save a file on my project I get an error message saying: The document \"nameOfFile.m\" could not be saved. I tried reins

相关标签:
15条回答
  • 2021-02-20 01:19

    I just ran into the same problem, then I noticed I ran out of disk space. You can disable the warning that pops up when you run low on disk space (perhaps not a wise thing to do). I did that a few days ago and was puzzled for a moment when this message appeared. They could've just said "Disk full" or something instead of "cannot save". Anyway if anyone ever runs into this just free up some disk space.

    You might be able to save in an external editor because its not also building your app which might use up the little remaining space. It might also be why it worked after rebooting (if OS X cleaned up some cached stuff on reboot) so it seems plausible.

    Either that or your HDD might have just crashed. tic....tic....tic.....

    0 讨论(0)
  • 2021-02-20 01:25

    Make sure you have you mouse focused on the code area and not the file in the file list.

    0 讨论(0)
  • 2021-02-20 01:25

    Not sure why but the temp files ended in a odd state. In "/private/var/folders" I simply removed all the folders and it cleared up the problem

    cd /private/var/folders
    
    sudo rm -fR *
    

    Note: never do a "sudo rm" unless you really know what you are doing. It can cause irrecoverable damage

    0 讨论(0)
  • 2021-02-20 01:28

    In my Case, the File which was saying document could not be saved was basically Shortcut/Allies of the file present at another place.

    I don't know why it was not able to save if it was opened by shortcut/allies in xcode but by overwriting(Copy and Paste) the orignal files to that shortcut my problem was solved.

    Regards Umair Bhatti

    0 讨论(0)
  • 2021-02-20 01:28

    Another possible reason is that the file you are trying to modify is an alias (i.e. a soft link).

    You will have to modify the source file directly in this case.

    0 讨论(0)
  • 2021-02-20 01:29

    I have face this issue many times. I followed below steps to fixed this.

    1. Select file->Show in Finder
    2. Copy those file and past different destination.
    3. Remove those file from xCode (to selecting show in finder)
    4. Then again add those files from other destination to actual location 
    5. Clean code and run the code.
    
    0 讨论(0)
提交回复
热议问题