为什么我不能从我的XCode项目中删除文件? [英] Why can't I delete files from my XCode project?

查看:181
本文介绍了为什么我不能从我的XCode项目中删除文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个非常简单的问题,但是我无法从我的XCode项目中删除资源。我使用为所有添加的文件夹创建文件夹引用添加了它们,这样我就可以导入一个完整的离线HTML网站,其正确的文件夹结构。



不幸的是,像这样添加我似乎无法删除结构中的单个文件(它不是从编辑菜单中可用)。

任何人都可以帮忙吗?谢谢!

解决方案

这不是文件夹引用的工作方式。这个想法是唯一的一个参考,你可以打开其中的文件并从这些编辑器中保存,你可以删除或移动整个Xcode项目的整个引用,但是你不能实际编辑它 - 它的只读xcode是关心的。同样,你也不能重组它(移动内部文件)。

我不确定为什么苹果决定这样做,但显然他们有。 p>

如果您想知道如何使用xcode文件夹系统,下面是我倾向于将它们用于我的项目:

每当我将代码细分到文件夹,当我把它们拖到我的项目中,我点击递归创建组添加文件夹。如果你这样做,你在xcode中所做的任何更改都不会反映实际的文件本身。据我所知,没有办法做到这一点。接下来发生的事情是,当你添加一个新的代码文件时,默认情况下该目录在该文件中开始。即当您创建一个新文件时,您不需要手动导航到它。



每当我为应用程序处理内容时,使用。这样,我添加了所有的图像,文件夹,配置文件,而且xcode立即列出它们。我在Xcode中的原因,我可以通过拖动文件夹引用到复制文件构建阶段将文件复制到可执行文件目录。
$ b

基本上(据我所知)如何使用Xcode中的文件夹类型 - 不幸的是,我不知道如何实现你想要的功能。您可能必须手动删除finder中的文件夹,如果您使用文件夹引用,则会将xcode更新为更改。


This is probably a very easy question, but I'm having trouble deleting resources from my XCode project. I added them using "Create Folder References for any added folders" so that I could import a whole offline HTML site with its correct folder structure.

Unfortunately, now it has been added like this I don't seem to be able to delete individual files in the structure (it's not available from the Edit menu).

Can anyone help please? Thanks!

解决方案

That isn't how folder references work. The idea is that its only a reference, you can open files within it and save it from those editors, you can delete or move the entire reference throughout the xcode project, but you can't actually edit it - its read only as far as xcode is concerned. Likewise, you cannot restructure it (move internal files around).

I'm not to sure why apple decided to make this the case, but apparently they have.

If you want to know how one might use the xcode folder system, here's how I tend to use them with my projects:

Whenever I subdivide code into folders, when I drag them into my project I click "recursively create groups for any added folders". If you do this, you any changes you make within xcode will not reflect the actual file itself. As far as I know, there is no way to do this. What does happen then is that when you add a new code file to it, the directory starts off in that file by default. ie, you don't need to navigate to it manually when you create a new file.

I use folder references whenever I'm working with content for an application I'm using. This way, I add all my images, folders, configuration files, whatever - and xcode immediately lists them. The reason I have it within xcode, I can I copy the files into the executables directory by dragging the folder reference into a "Copy Files" build phase.

Thats basically (to my knowledge) how one uses the folder types within xcode - sadly, I don't know how to achieve the functionality you want. You may have to manually delete the folders in finder, which if you do use folder references will update xcode to the change.

这篇关于为什么我不能从我的XCode项目中删除文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆