简体   繁体   English

为什么我不能只将压缩的Xcode项目文件夹发送给朋友,并且可以工作?

[英]Why can't I just send my zipped Xcode project folder to a friend, and it works?

I always use one folder on my filesystem for an Xcode project. 我总是将文件系统上的一个文件夹用于Xcode项目。 It contains all project files. 它包含所有项目文件。 When I zip it and send it to a friend, she can't just ipen the xcodeproj file. 当我将其压缩并发送给朋友时,她不能只使用xcodeproj文件。 It opens, but all paths are broken and build fails because all the classes don't find the #include'd files. 它打开了,但是所有路径都被破坏了,构建失败了,因为所有的类都找不到#include的文件。 But when I download ie some example projects from apple, these work perfectly. 但是,当我从苹果公司下载一些示例项目时,它们可以完美地工作。 What am I doing wrong? 我究竟做错了什么?

UPDATE: 更新:

I'm doing it like this: 我正在这样做:

1) I create a project and specify an directory on my desktop 1)我创建一个项目并在桌面上指定一个目录

2) In that directory I create an "images" directory and add images to it 2)在该目录中,我创建一个“图像”目录并向其中添加图像

3) I pull this images directory out and drag it into the Resources Groups&Files. 3)我将这个图像目录拉出并拖到资源组和文件中。 Xcode asks if I want to copy it to destination folder, I click no. Xcode询问是否要将其复制到目标文件夹,请单击“否”。 Because it's already there. 因为它已经在那里。 All other things are set to default. 所有其他内容均设置为默认值。

4) all other things are just created within xcode, and xcode just puts all classes in the Classes directory of my project. 4)所有其他内容都是在xcode中创建的,xcode只是将所有类放入我项目的Classes目录中。

5) when I want to add images, I first put them in the directory of the project, and from there drag them into the Images group in xcode. 5)当我想添加图像时,我首先将它们放在项目目录中,然后从那里将它们拖到xcode的Images组中。 That's to make sure xcode doesn't mess them up with everything else. 这是为了确保xcode不会将它们与其他所有东西弄混。 Otherwise it would just copy them to the root of my project directory rather than inside the Images directory, which doesn't make sense. 否则,只会将它们复制到我的项目目录的根目录中,而不是复制到Images目录中,这没有任何意义。 In fact, the whole Groups&Files filesystem doesn't make sense at all, it's one big mess. 实际上,整个Groups&Files文件系统根本没有任何意义,这是一个很大的麻烦。 Apple's biggest mistake in Xcode so far. 迄今为止,Apple在Xcode中最大的错误。 That's why I have to do such stupid things. 这就是为什么我必须做这些愚蠢的事情。

We don't really know exactly what you're doing so it's hard to see what you're doing wrong. 我们真的不完全知道您在做什么,因此很难看出您在做错什么。

Perhaps inspect the xcode project files directly, see if you have hardcoded paths. 也许直接检查xcode项目文件,看看是否有硬编码的路径。 That's a sure fire problem. 那肯定是火灾的问题。 Make sure you copy resources into the project instead of referencing them externally, etc. 确保将资源复制到项目中,而不是在外部进行引用等。

I expect that you have "search path" build setting set to an absolute path on your machine, rather than a path relative to the project. 我希望您将“搜索路径”构建设置设置为计算机上的绝对路径,而不是相对于项目的相对路径。 Best way to tell is to post a portion of the build transcript from the failed build and look at the -I directives. 最好的判断方法是从失败的构建中发布构建脚本的一部分,并查看-I指令。 If those paths don't exist on your friend's machine, then they should be changed from absolute paths to paths that start with ${SRCROOT}. 如果您朋友的计算机上不存在这些路径,则应将它们从绝对路径更改为以$ {SRCROOT}开头的路径。

Are you just trying to build on the second machine or are you trying to deploy to a device on the second machine? 您是在尝试在第二台计算机上构建还是在第二台计算机上部署设备? If you are trying to deploy to a device (iPhone or iPod Touch) then it probably has something to do with Code Signing and Certificates. 如果您尝试部署到设备(iPhone或iPod Touch),则它可能与代码签名和证书有关。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM