开发者

Remove files from Xcode project

开发者 https://www.devze.com 2023-04-05 13:53 出处:网络
I do not know why, but somehow two files were added to project with a mistake as you can see on screenshot. How can I safely remove them from Xcode project? I\'ve already deleted them from disk开发者_

I do not know why, but somehow two files were added to project with a mistake as you can see on screenshot. How can I safely remove them from Xcode project? I've already deleted them from disk开发者_开发百科, but delete button is grayed out in Xcode interface.

Remove files from Xcode project


Just had this problem today. The fix for me (on Mac) was:

  1. Find YourProjectName.xcodeproj in finder.
  2. Right click > Show package contents.
  3. Inside there, right click on project.xcworkspace > Show package contents.
  4. Open contents.xcworkspacedata (XML format) in any text editor and manually remove the references.

Hope this helps anyone with the same issue!


Do a clean of all targets and then remove the app from simulator. Finally, relaunch it.


Quit Xcode and relaunch to fix it.


I can't replicate your problem, but you could give this a shot:

Close Xcode. Right-click your .xcodeproj file, show package contents. Make a copy of your project.pbxproj somewhere as a backup, then open the original in TextEdit. Find "MyClass.h" in the file. You should find a few lines containing it; just delete the entire line each time (including the line break). Do the same for "MyClass.m". Then save, and open your project.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号