cannot edit .xcworkspace/contents file

2019-09-14 18:15发布

问题:

After deleting unwanted .xcdatamodeld files in "YourProject".xcodeproj file, I encountered 3 new warnings linked to the "YourProject".xcWorkspace file. The warnings are:

  • contents is missing from working copy
  • .xccurrentversion is missing from working copy
  • contents is missing from working copy

After editing .xcodeproj/project.pbxproj, I tried to unpackage contents in .xcworkspace file. At this point, Xcode and my text editor does not allow me to edit .xcworkspace/contents. Any ideas how to edit this file, and remove the above three warnings?

I tried to follow the rare solution found on Stackoverflow here to remove xcdatamodels, but clearly the solution does not address the warnings that occur when a .xcworkspace file is still looking for the old project files successfully removed from .xcodeproj.

Thanks for any suggestions.

回答1:

Rather than trying to edit the above warnings by opening/editing .xcworkspace/..., I followed the advice in this Stackoverflow answer about missing ****.png files and the similar warnings. Warnings disappeared as soon as I made the latest commit to Github.