Xcode,正在更改应用程序子文件夹? [英] Xcode, changing applications subfolder?

查看:56
本文介绍了Xcode,正在更改应用程序子文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,今天您注意到在编写一个简单的iPhone应用程序时,Xcode有时会在应用程序中启动一个新文件夹,而您仍在使用同一应用程序.

Hi have noticed today whilst writing a simple iPhone app that Xcode sometimes starts a new folder in applications, whilst your still working on the same app.

/Users/Fuzzygoat/Library/Application Support/iPhone Simulator/User/Applications/4E5EF4F0-F410-46A6-888C-0D23BB97D2DC

有人知道是什么原因导致Xcode交换到新的应用程序文件夹(即名为"4E5EF4F0-F410-46A6-888C-0D23BB97D2DC"的文件夹)

Does anyone know what causes Xcode to swap to a new app folder (i.e. the one named "4E5EF4F0-F410-46A6-888C-0D23BB97D2DC")

EDIT_001:我注意到的一件事是,我一直在做很多事情,退出应用程序并重新开始检查一组存档方法,这有时会使它感到困惑.有几次它没有找到保存的数据,我想这只是通过Xcode不断运行模拟器的副作用.如果我在不使用Xcode的模拟器上进行测试,事情似乎就很好了,首先,该文件夹将保持相同的名称.

EDIT_001: One thing I have noticed is that I have been doing a lot of quitting an application and restarting to check a set of archive methods, and that does tend to confuse it sometimes. A couple of times it has not found saved data, I guess this is just a side effect of constantly running the simulator over and over via Xcode. Things seem to go just fine if I test on the Simulator without Xcode, for a start the folder keeps the same name.

NB:我每次使用NSSearchPathForDirectoriesInDomains来获取documents文件夹.

NB: I am using NSSearchPathForDirectoriesInDomains to get the documents folder each time.

加里

推荐答案

出于安全原因,iPhone OS将应用程序(包括其首选项和数据)限制为文件系统中的唯一位置.此限制是安全功能(称为应用程序的沙箱")的一部分.沙箱是一组细粒度的控件,它们限制了应用程序对文件,首选项,网络资源,硬件等的访问.在iPhone OS中,应用程序及其数据驻留在其他应用程序无法访问的安全位置.安装应用程序后,系统会为该应用程序计算一个唯一的不透明标识符.系统使用根应用程序目录和此标识符来构造到应用程序主目录的路径.因此,应用程序的主目录可以描述为具有以下结构:

For security reasons, iPhone OS restricts an application (including its preferences and data) to a unique location in the file system. This restriction is part of the security feature known as the application’s "sandbox." The sandbox is a set of fine-grained controls limiting an application’s access to files, preferences, network resources, hardware, and so on. In iPhone OS, an application and its data reside in a secure location that no other application can access. When an application is installed, the system computes a unique opaque identifier for the application. Using a root application directory and this identifier, the system constructs a path to the application’s home directory. Thus an application’s home directory could be depicted as having the following structure:

  /ApplicationRoot/ApplicationID/

在安装过程中,系统会创建应用程序的主目录和几个关键子目录,配置应用程序沙箱,然后将应用程序捆绑包复制到主目录.对每个应用程序及其数据使用唯一的位置可简化备份和还原操作,应用程序更新和卸载.有关为每个应用程序创建的特定于应用程序的目录以及应用程序更新以及备份和还原操作的更多信息.

During the installation process, the system creates the application’s home directory and several key subdirectories, configures the application sandbox, and copies the application bundle to the home directory. The use of a unique location for each application and its data simplifies backup-and-restore operations, application updates, and uninstallation. For more information about the application-specific directories created for each application and about application updates and backup-and-restore operations.

请参见 查看全文

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