iOS 中的沙盒是什么?我可以在一个应用程序之间传输数据到另一个应用程序吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12055990/
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
What is Sandbox in iOS? Can I transfer data between one app to another app?
提问by user1614347
Is there anything like sandboxing an iPhone Application, what are the benefits on using sandboxes and do they allow me sharing data between one app and another?
有没有像对 iPhone 应用程序进行沙盒处理之类的东西,使用沙盒有什么好处,它们是否允许我在一个应用程序和另一个应用程序之间共享数据?
I found this link while searching but not able to understand as I'm new to iOS development.
我在搜索时发现了这个链接,但由于我是 iOS 开发的新手,所以无法理解。
http://www.iphonedevsdk.com/forum/iphone-sdk-development/56207-what-is-sandbox-in-iphone.html
http://www.iphonedevsdk.com/forum/iphone-sdk-development/56207-what-is-sandbox-in-iphone.html
回答by CarlJ
From The iOS Environment
来自iOS 环境
For security reasons, iOS places each app (including its preferences and data) in a sandbox at install time. A sandbox is a set of fine-grained controls that limit the app's access to files, preferences, network resources, hardware, and so on. As part of the sandboxing process, the system installs each app in its own sandbox directory, which acts as the home for the app and its data.
出于安全原因,iOS 在安装时将每个应用程序(包括其首选项和数据)放在沙箱中。沙箱是一组细粒度的控件,用于限制应用程序对文件、首选项、网络资源、硬件等的访问。作为沙盒过程的一部分,系统将每个应用程序安装在自己的沙盒目录中,该目录充当应用程序及其数据的家。
one solution to transmit data from one to another app is via URL Schemes
将数据从一个应用程序传输到另一个应用程序的一种解决方案是通过URL Schemes
回答by Hsaka
Mobile device application developers use the sandboxing capability of iOS to ensure the security of the user data and to ensure that the application don't share data with other applications installed on the same device.
移动设备应用程序开发人员使用 iOS 的沙盒功能来确保用户数据的安全,并确保应用程序不会与安装在同一设备上的其他应用程序共享数据。
The sandbox forms and maintains a private environment of data and information for each app.
The sandbox can minimize the damage that can be done from a potential hacker but it can't prevent the attack from happening.
Although Apple has built robust sandboxing features into iOS , it is upto the developer's to ensure that their apps are written securely.
When an app is installed on a mobile device, the system creates a unique directory for it.
Sandboxing only prevents the hiHymaned app from affecting the other apps and also other parts of the system.
沙箱为每个应用程序形成并维护数据和信息的私有环境。
沙箱可以最大限度地减少潜在黑客可能造成的损害,但无法阻止攻击的发生。
尽管 Apple 已经在 iOS 中内置了强大的沙盒功能,但开发人员应该确保他们的应用程序的编写安全。
当应用程序安装在移动设备上时,系统会为其创建一个唯一的目录。
沙盒仅防止被劫持的应用程序影响其他应用程序以及系统的其他部分。
回答by stevex
iPhone apps are all sandboxed, meaning there is no sharing of files between applications.
iPhone 应用程序都是沙盒化的,这意味着应用程序之间没有文件共享。
There are some ways of transferring data between applications but they're very limited. Look at URL schemes.
有应用程序之间传输数据的某些方面,但他们非常有限。查看 URL 方案。
回答by user2238045
The apps are in sandbox by default. You do not need to worry about putting it in a sandbox manually.
默认情况下,应用程序位于沙箱中。您无需担心手动将其放入沙箱。