将资源文件添加到 xcode
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10247680/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Adding resource files to xcode
提问by dole doug
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.
我正在尝试将一些新的资源文件添加到另一个人在另一台 mac 上构建的项目中。我认为该项目有前人的规定。
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.
使用右键单击->将文件添加到“MyProject”不会提供预期的结果。编译项目后,添加的文件在应用程序中不可见。
How can I add new resources in my project?
如何在我的项目中添加新资源?
PS: I'm trying to learn Objective-C
in a macincloud.com
account.
PS:我正在尝试Objective-C
在macincloud.com
帐户中学习。
回答by Paul Peelen
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).
可能是您添加的文件未添加到项目构建中。点击你的project
> App target
> Build Phases
,并检查文件中是否存在Compile sources
(如果需要编译),否则检查Copy bundle resources
。如果该文件在那里不存在,请将其拖到那里,它应该没问题(根据我对您的问题的理解)。
EDIT
编辑
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.
你也可以请检查是否一个文件被点击该文件,并打开“文件检查器”(添加到目标View
> Utilities
> Show File Inspector
,或?+ ?+ 1),并检查Target Membership
部分。
回答by vpathak
Just drag the resource file (from a finder window) into your project files area (left side) and drop in supporting files.
只需将资源文件(从查找器窗口)拖到项目文件区域(左侧)并放入支持文件即可。
Once you drop, a dialog will prompt you which targets to add it for. Select all that are appropriate. Thats it.
删除后,会出现一个对话框,提示您将其添加到哪些目标。选择所有合适的。就是这样。