在 Xcode 4 中添加文件:确保路径相对于项目/如何更改路径?
在 Xcode 4 中,我无法将文件/资源添加到我的项目中,除非相对组路径最终如下所示: ../../workspace/Project/Resources/thing.png
理想情况下我会有Resources/thing.png
。
我尝试了添加文件夹、文件、创建新组的所有可能组合。我希望将资源保存在项目目录中的文件夹中。如果我省略该文件夹,显然我的资产将与项目相关 - 只是项目根目录下的“thing.png”。
有什么方法可以更改单个文件的路径(我已经知道如何“更改组代表的位置”),以便我可以手动设置位置(例如在 Xcode 3 中,其中这条路径的废话也会发生)。
In Xcode 4, I can't add files/resources to my project without having the Relative-to-Group path end up something like: ../../workspace/Project/Resources/thing.png
Ideally I would have Resources/thing.png
.
I have tried every possible combination of adding folders, files, making new groups. I wish to keep my resources in a folder within my project directory. If I omit the folder, clearly my assets will be relative to the project — just "thing.png" under the project's root.
Is there any way to change the path of a single file (I already know how to 'change the location the group represents') such that I can set the location manually (such as in Xcode 3, where this path crap would happen as well).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我的肮脏但简单的解决方案:
My dirty, but simple solution to this:
我遇到了同样的问题。事实证明,问题出在 Dropbox 上,它会出于某种原因重写 Xcode 的路径。
将项目移至 Dropbox 之外的其他位置解决了该问题。
I ran into the same issue. It turned out that the problem was Dropbox that would rewrite the paths for Xcode for some reason.
Moving the project to another location outside of my Dropbox solved the issue.
在更改代表文件夹的组的同一区域下(直接在“文件实用程序”区域的“身份和类型”组中的“位置”弹出窗口下方),文件名右侧有一个小图标。单击该按钮并再次选择该文件。这将更新路径。
Under the same area in which you change the groups represented folder, (directly under the Location popup in the Identity and Type group of the File Utility area), there's a small icon to the right of the file name. Click that and choose the file again. That will update the path.