Xcode: "The document could not be saved. You don’t have permission."

I'm getting this error when trying to save a file in Xcode 4: "The document could not be saved. You don’t have permission. To view or change permissions, select the item in the Finder and choose File > Get Info." Naturally, saving the file in TextMate works fine. Permissions: -rw-r--r-- Nothing changed from when it worked the last time. Files are not locked, I tried rebooting, disk space is ok, files are on a local drive, error was googled. Any ideas? Thanks. Update: Also tried copying the files or renaming them. Directories are not locked. By the way, when I edited project configuration in Xcode it saves fine, I only met with the issue saving .m/.h files. I guess that copying the actual text in the files would work but I'm trying to find a bit less hardcore solution (bash script wouldn't be the issue but there could be other problems). It's not the simplest project either (~70 files, edited config). Update 2: Found possible duplicate, doesn't really resolve the problem Unable to unlock file for editing in Xcode 4? Update 3: Checked out earlier commit and when opening Xcode it said the project is locked. Checked out the same commit again and the error does not appear again (all files exc. DS_Store are tracked). What. Update 4: I created a new user and set chmod -R 777 to the project directory. Editing now works fine. However I can't get it to work under my main account (I have all my preferences here.)

1 1 1 silver badge asked Nov 8, 2011 at 13:36 1,222 1 1 gold badge 14 14 silver badges 17 17 bronze badges

9 Answers 9

Rebooting fixed the error in my case.

answered Dec 11, 2011 at 10:54 HansPinckaers HansPinckaers 1,745 15 15 silver badges 18 18 bronze badges didn't help here. (yes, after a month I still haven't solved it) Commented Dec 17, 2011 at 3:06 in my case too! Commented Oct 31, 2016 at 10:21

+1, I had to force-terminate XCode in order to reboot. Looks like XCode keeps a daemon running even when you quit it.