When I started working on my first app, i assumed dragging files into xcode put them in my project's actual directory. Not so. Apparently, xcode references them all on the desktop.
当我开始处理我的第一个应用程序时,我假设将文件拖入xcode,将它们放在我项目的实际目录中。不是这样。显然,xcode会在桌面上引用它们。
Is there an easy way to copy all referenced files into the project directory? My desktop is a mess.
有没有一种简单的方法可以将所有引用的文件复制到项目目录中?我的桌面很乱。
4 个解决方案
#1
There really isn't a straightforward way to do this once you've added the references to the XCode project. One solution (although tedious and slightly scary) is to remove the references from XCode and re-drag these files into your project with the "Copy files..." option checked.
一旦添加了对XCode项目的引用,就没有一种简单的方法可以做到这一点。一个解决方案(虽然繁琐且有点可怕)是从XCode中删除引用并将这些文件重新拖动到项目中,并选中“复制文件...”选项。
#2
Use the Finder to relocate all the files to where you want them. Then, open your XCode projects, and for each file that's missing (shown in red), use the Get Info command and edit the path.
使用Finder将所有文件重定位到您想要的位置。然后,打开您的XCode项目,并为每个缺少的文件(以红色显示),使用Get Info命令并编辑路径。
#3
Even when you check the "Copy files ..." checkbox when you drag your files in, it's done "When necessary", without telling us when it thinks it's deemed not necessary to copy the files. I'd find that the best way to check if a bundle is self-contained is to compress it to .zip (the entire folder), move it to a temp folder, decompress and then go through all the files, or simply compile and run.
即使您在拖动文件时选中“复制文件...”复选框,也会在“必要时”完成,而不会告诉我们何时认为没有必要复制文件。我发现检查捆绑包是否自包含的最佳方法是将其压缩为.zip(整个文件夹),将其移动到临时文件夹,解压缩然后遍历所有文件,或者只是编译和跑。
It's amazing that xcode doesn't have a consolidate function like itunes does.
令人惊讶的是,xcode没有像itunes那样的整合功能。
#4
From Xcode, you can right-click the project and select "Add -> Existing files..." When you have selected all your files, click "Add," then select the check box at the top "Copy files..."
在Xcode中,您可以右键单击项目并选择“添加 - >现有文件...”。选择所有文件后,单击“添加”,然后选中顶部“复制文件...”复选框。
#1
There really isn't a straightforward way to do this once you've added the references to the XCode project. One solution (although tedious and slightly scary) is to remove the references from XCode and re-drag these files into your project with the "Copy files..." option checked.
一旦添加了对XCode项目的引用,就没有一种简单的方法可以做到这一点。一个解决方案(虽然繁琐且有点可怕)是从XCode中删除引用并将这些文件重新拖动到项目中,并选中“复制文件...”选项。
#2
Use the Finder to relocate all the files to where you want them. Then, open your XCode projects, and for each file that's missing (shown in red), use the Get Info command and edit the path.
使用Finder将所有文件重定位到您想要的位置。然后,打开您的XCode项目,并为每个缺少的文件(以红色显示),使用Get Info命令并编辑路径。
#3
Even when you check the "Copy files ..." checkbox when you drag your files in, it's done "When necessary", without telling us when it thinks it's deemed not necessary to copy the files. I'd find that the best way to check if a bundle is self-contained is to compress it to .zip (the entire folder), move it to a temp folder, decompress and then go through all the files, or simply compile and run.
即使您在拖动文件时选中“复制文件...”复选框,也会在“必要时”完成,而不会告诉我们何时认为没有必要复制文件。我发现检查捆绑包是否自包含的最佳方法是将其压缩为.zip(整个文件夹),将其移动到临时文件夹,解压缩然后遍历所有文件,或者只是编译和跑。
It's amazing that xcode doesn't have a consolidate function like itunes does.
令人惊讶的是,xcode没有像itunes那样的整合功能。
#4
From Xcode, you can right-click the project and select "Add -> Existing files..." When you have selected all your files, click "Add," then select the check box at the top "Copy files..."
在Xcode中,您可以右键单击项目并选择“添加 - >现有文件...”。选择所有文件后,单击“添加”,然后选中顶部“复制文件...”复选框。