Remove files from Xcode project
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.
Just had this problem today. The fix for me (on Mac) was:
- Find YourProjectName.xcodeproj in finder.
- Right click > Show package contents.
- Inside there, right click on project.xcworkspace > Show package contents.
- 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.
精彩评论