views:

431

answers:

4

Hi,

Is it possible to share a core data store between two different iPhone apps signed by the same developer? I would like to develop an application where one iPhone app will save a stream of data, which can then be read by the other app. Is this even possible? Thanks a lot!

+4  A: 

No, that's not possible. An iPhone application runs in a sandbox and though doesn't have access to another applications data store.

Edit:

After reading the others answers here: Yes, Custom URLs are possible. And yes it's possible to transfer data with it, but, I, in my opinion, wouldn't recommend this procedure to transfer more than 5kb of data. There is no failsafe: No transactions and no relations.

Henrik P. Hessel
Just as I thought. But wouldn't hurt to ask.
futureelite7
Never hurts. Indeed :)
Henrik P. Hessel
+1  A: 

You could use a custom URL scheme to send the data to the second App.

-t

Tim
+1  A: 

This can be done using a custom url scheme on the iphone, with some caveats.

If you use a custom url scheme, only one app "owns" the data. The other app would have to import data from the main app... Mobile Orchard did an article on this for moving data from a lite app to a paid for app

http://www.mobileorchard.com/lite-to-paid-iphone-application-data-migrations-with-custom-url-handlers/

But I recently came across an MIT licensed library called "SwapKit" that may do exactly what you want as well... Sounds good from the overview on their site, though I haven't tried it:

http://infinite-labs.net/swapkit/

and this may or may not be of any help, but check out "SpyPhone" too:

SpyPhone shows the kind of data a rogue application can collect in a non jailbroken iPhone.

http://github.com/nst/SpyPhone

Brad Parks
+1  A: 

There's also the system pasteboard (I think it's NSPasteboard or something, no time to check right now) which is basically the clipboard. I think you can put stuff on it and then launch another app with a URL that tells the other app to check the pasteboard.

Nimrod