Search This Blog

Thursday, April 26, 2012

XCode Problems Again...

The latest XCode periodically displays this message before it crashes:

The document “Foo.m” could not be saved. The file has been changed by another application.


Click Save Anyway to keep your changes and save the changes made by the other application as a version, or click Revert to keep the changes from the other application and save your changes as a version.

Then XCode in its entirety hangs.

A summary of the call back is here:

[NSDocument performAsynchronousFileAccessUsingBlock:][0x7fff8ca40fa1]
[NSDocument _fileCoordinator:coordinateReadingContentsAndWritingItemAtURL:byAccessor:][NSFileCoordinator _coordinateReadingItemAtURL:options:writingItemAtURL:options:error:byAccessor:][NSFileCoordinator(NSPrivate) _invokeAccessor:orDont:thenRelinquishAccessClaimForID:][NSDocument saveToURL:ofType:forSaveOperation:completionHandler:]
[NSDocument saveToURL:ofType:forSaveOperation:completionHandler:][NSDocument saveToURL:ofType:forSaveOperation:completionHandler:]
[IDEEditorDocument saveToURL:ofType:forSaveOperation:completionHandler:][IDEWorkspaceDocument performBlockAfterPreBuildSave:]
[NSDocumentController presentError:]

The cause?  Having two projects open that share a file.

Not actually editing the shared file.

Simply having them open.