将资源文件添加到 xcode [英] Adding resource files to xcode
问题描述
我正在尝试将一些新的资源文件添加到另一个人在另一台 Mac 上构建的项目中.我认为该项目有前人的规定.
I'm trying to add some new resource files to a project which was build by another person on another mac. I think that the project has the provision of the previous person.
使用右键单击->将文件添加到MyProject"不会提供预期的结果.我编译项目后,添加的文件在应用程序中不可见.
Using right click->Add Files to "MyProject" doesn't provide the expected result. After I compile the project, the added file is not visible in the application.
如何在我的项目中添加新资源?
How can I add new resources in my project?
PS:我正在尝试在 macincloud.com
帐户中学习 Objective-C
.
PS: I'm trying to learn Objective-C
in a macincloud.com
account.
推荐答案
可能是您添加的文件未添加到项目构建中.点击您的 project
> App target
> Build Phases
并检查Compile sources
中是否存在该文件(如果需要编译),否则检查Copy bundle resources
.如果该文件不存在,请将其拖到那里,应该没问题(根据我对您的问题的理解).
It might be that the file you added was not added to the project build. Click your project
> App target
> Build Phases
And check that the file exists in Compile sources
(if it needs to be compiled), otherwise check Copy bundle resources
. If the file does not exist there, drag it there and it should be fine, (from what I understand of your question).
编辑
您还可以通过单击文件并打开文件检查器"(View
> Utilities
> Show FileInspector
或 ⌥ + ⌘ + 1),然后检查 Target Membership
部分.
You can also check wether a file is added to the target by clicking the file and opening the "File Inspector" (View
> Utilities
> Show File Inspector
, or ⌥ + ⌘ + 1), and check the Target Membership
section.
示例:
这篇关于将资源文件添加到 xcode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!