Xcode error with Cocoapod: "The document could not be saved. The file doesn’t exist"

For what it's worth, in my case the error came up when I was trying to edit a file pointed to by the warning/error pane in Xcode.

Not sure if that's cocoa pod related but I happen to be using pods also.

Basically you get an error, click on it and try to modify the file to fix the error and sometimes, not sure how, Xcode produces this error.

Since Xcode is stuck trying to save the changes to the file, you have to undo any changes you're made to the file in the error browser. Then editing the file by clicking on it in the regular browser instead of the warning/error pane will let you modify the file and save it.

I'm running Xcode 6.1.1 and Cocoapods 0.36.0.rc.1 and this happens when trying to modify a file from a pod added as a development pod (i.e. from a local directory).


I was facing this problem while I was developing objective-c pod and one of the file(say xx.h &.m) in Classes folder was giving this error prompt. I did following approach:

  1. I copied xx(.h&.m) some where else (say Desktop)
  2. Delete xx(.h&.m) completely from classes folder .
  3. Force quit Xcode
  4. Reopen the project
  5. Drag the file xx(.h&.m) . Select 'copy item if needed' and 'target'.

problem solved!