Xcode不会放过一个资源文件 [英] Xcode won't let go a resource file

查看:121
本文介绍了Xcode不会放过一个资源文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天的问题是关于Xcode如何处理它创建的应用程序包中的资源文件。我知道这可能是微不足道的,但我找不到一个简单的方法。
基本上我的问题是,即使文件已经从项目中删除,Xcode似乎仍然在应用程序包中包含资源文件(例如文本文件)。
这里详细介绍了这里正在发生的事情。

 ⁃向项目中添加了一个文件(通过选择文件 - 新文件或拖动文件到Xcode组和文件左列检查添加到项目文件夹如果需要复选框)
⁃在模拟器
中编译和启动项目⁃验证文件存在myApp中。位于用户/库/应用程序/支持/ iPhone模拟器/ 3.2 /应用程序/<应用程序系统编号> /myApp.app,甚至在< my Xcode项目文件夹> /myApp/build/debugiPhonesimulator/myApp.app
⁃从Xcode中的组和文件列删除文件
&在< my Xcode项目文件夹> / myApp / myFile
中删除Finder中的实际文件⁃删除的用户/库/ Support / iPhone Simulator / 3.2 / Applications /< application system number> /myApp.app,甚至< b⁃经Finder聚光灯确认没有文件引用
⁃通过Xcode搜索验证没有对该文件的引用
⁃在模拟器
中重建并重新启动应用程序⁃验证一个全新的/ Library / Application / Support / iPhone Simulator / 3.2 / Applications /< application system number> /myApp.app已经被创建了
⁃验证了/ Library / Application / Support / iPhone Simulator / 3.2 / Applications /< application system number> /myApp.app bundle:文件仍然存在。 h。 Xcode采取了从?

我肯定错过了一些非常明显的东西。任何帮助?

解决方案

您是否检查过目标节点?如果不是,那么;


  • 展开目标节点和应用程序之一。

  • 是一个名为Copy Bundle Resources的构建阶段。

  • 检查资源是否在阶段中。


您也可以尝试彻底清理项目,以确保没有临时文件。


My question today is about how Xcode deals with resource files in the app bundle which it creates. I know that it may be trivial, but I can't find an easy way out. Basically my problem is that Xcode seems to keep on including a resource file (eg a text file) in the app bundle even if the file has been removed from the project. Here it is in detail what is happening here.

⁃   Added a file to the project (both by choosing file - new file or dragging a file to the Xcode groups and files left column checking add to project folder if needed checkbox)
⁃   Compiled and launched the project in simulator
⁃   Verified that the file is present in myApp.app bundle, located in User/Library/Application/Support/iPhone Simulator/3.2/Applications/<application system number>/myApp.app and even in <my Xcode projects folder>/myApp/build/debugiPhonesimulator/myApp.app
⁃   Deleted the file from groups and files column in Xcode
⁃   Deleted the actual file with Finder in <my Xcode projects folder>/myApp/myFile
⁃   Deleted User/Library/Application/Support/iPhone Simulator/3.2/Applications/<application system number>/myApp.app and even <my Xcode projects folder>/myApp/build/debugiPhonesimulator/myApp.app
⁃   Emptied the trash
⁃   Verified that there is no reference to the file with Finder spotlight
⁃   Verified that there is no reference to the file with Xcode search
⁃   Rebuilt and relaunched the app in simulator
⁃   Verified that a brand new /Library/Application/Support/iPhone Simulator/3.2/Applications/<application system number>/myApp.app has been just created
⁃   Verified the content of /Library/Application/Support/iPhone Simulator/3.2/Applications/<application system number>/myApp.app bundle: the file is still there. Where the h. did Xcode take it from?

I am surely missing something really obvious. Any help?

解决方案

Have you checked the "Targets" node ? If not then;

  • Expand the "Targets" node and the application one.
  • There must be a build phase called "Copy Bundle Resources".
  • Check that the resource is not in the phase.

You can also try to perform a full clean of the project to ensure that no temporary files stay.

这篇关于Xcode不会放过一个资源文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆