What is the equivalent of Android content provider in IOS?

瘦欲@ 提交于 2019-11-28 06:00:42

问题


What is the equivalent of Android's content provider in iOS?

Summary:

A content provider manages access to a central repository of data. A provider is part of an Android application, which often provides its own UI for working with the data. However, content providers are primarily intended to be used by other applications, which access the provider using a provider client object. Together, providers and provider clients offer a consistent, standard interface to data that also handles inter-process communication and secure data access.

Docs: http://developer.android.com/guide/topics/providers/content-providers.html


回答1:


If I'm understanding that link correctly, there is no equivalent.

On iOS, apps can't share resources between each other in that way. For security reasons, each app has it's own data and is sandboxed from being able to access the data within another app.

The only ways you could share data between apps is to have some network sync process between your apps, or possibly use UIPasteBoard but that's cumbersome. You can also pass very limited data via the app URL scheme.




回答2:


There's a way to share content between apps via keychain if one wanted to in iOS. I think this is the closest I can think of that is equivalent to the content provider in Android.

Good reference here: http://shaune.com.au/ios-keychain-sharing-data-between-apps/




回答3:


In iOS we can share data between apps having same group id.



来源:https://stackoverflow.com/questions/19371736/what-is-the-equivalent-of-android-content-provider-in-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!