4
  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)?

3 Answers 3

4

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.

4
  1. You can do this if you are developing for a jailbroken phone. Not otherwise.On jailbroken phones, you can create .dylibs or shared libraries that can be loaded via the DYLD_INSERT_LIBRARIES environment var (much like on MacOS)

  2. Apps are sandboxed. However, there are some ways of communicating between apps. You can use

    (a) customURL scheme (also mentioned by Tommy above) (if any) associated with an app to launch an app and send some parameters to the launching app

    (b) If you control communicating apps, then you can use Message ports (CFMessagePortCreateRemote)

    (c) If you control communicating apps, you could use Darwin NOtification center for distributed apps.

    Of course the expectation for (b) and (c) is that the communicating apps are all running. On iOS since there is only one foreground process, you'd have to have the other as a background app and that's restricted to certain kinds of apps on the iOS platform.

1
  • CFMessagePort is not available since iOS 7.
    – artyom.stv
    Commented Nov 26, 2014 at 10:57
1

Basically, no to all of the above, unless you're targeting jailbroken phones and are bypassing Apple's App Store. If you jailbreak, I believe you have similar options to those you have in Mac OS X.

1
  • Thankyou. With regards to 2) - different classes within an app can use NSNotificationCenter to communicate with each other, can NSNotificationCenter also be used between two apps?
    – Piepants
    Commented Dec 15, 2011 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.