本文介绍了iOS是否与DLL / IPC /进程产生有任何等价物?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  1. 单独的应用程序是否能够以类似DLL的形式共享相同的二进制文件?我知道编译静态库是可能的,但我不会将它们视为与DLL相同(即dll是多个应用程序共享的二进制文件的一个副本,而静态库由任何使用的应用程序单独包含)。 p>


  2. 每个应用程序是否彼此完全分离,是否有任何IPC或文件共享机制可供不同的应用程序进行通信和共享数据?


  3. 除了新线程之外,应用程序是否可以创建新进程(我猜不是)?



解决方案

您无法在应用程序之间共享可执行文件。 Apple要求所有应用程序独立运行。但是,您可以使用UIDocumentInteractionController来获取另一个程序来处理您不理解的文件,并且可以使用快速查看。例如,这就是Mail的工作原理。



来自同一供应商的程序可以共享钥匙串,我认为,iCloud存储从iOS 5开始,但无法在磁盘上共享存储。由于它们可以声明支持的文件类型,因此可以使用UIDocumentInteractionController将文件的临时访问从一个应用程序推送到另一个应用程序。如果有帮助,可以以类似的方式使用自定义URL方案来传递数据片段。



作为一般规则,一次只能有一个用户进程处于活动状态iOS - 例如后台处理基本上是基于事件的。因此,您无法为自己创建第二个流程。


  1. Are separate apps able to share the same binary in a form like a DLL? I know its possible to compile static libraries but I wouldn't count these as the same as a DLL (i.e. a dll is one copy of a binary shared by multiple apps, whereas static libraries are separately included by any using app).

  2. Is each app totally separate from each other, are there any IPC or file sharing mechanisms available for differing apps to communicate and share data?

  3. Is it possible for an app to create a new process in addition to a new thread (I guess not)?

解决方案

You can't share executable files between applications. Apple requires that all apps function standalone. However you can use a UIDocumentInteractionController to get another program to deal with files you don't understand, and a 'quick view' may be available. That's how Mail works, for example.

Programs from the same vendor can share the keychain and, I think, iCloud storage as of iOS 5, but can't share storage on disk. As they can declare supported file types, UIDocumentInteractionController can be used to push temporary access to a file from one app to another. A custom URL scheme can be used in a similar way to pass fragments of data if that helps.

As a general rule, only one user process may be active at once in iOS - e.g. background processing is essentially event based. So you can't create a second process for yourself.

这篇关于iOS是否与DLL / IPC /进程产生有任何等价物?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 23:58