1

As the title says - is there something in iOS that lets you say 'this file is allowed to be accessed by other apps' - preferably only readable, but read/write would be good enough.

Basically I am trying to place a file outside the sandbox so other apps can read it - preferably via the openURL that points to a local file rather than an http address.

Thanks

Edit: I just received an answer from Apple Tech support and they told me that this is currently impossible (just after iOS 6 released)

lifeIsGood
  • 1,229
  • 1
  • 15
  • 22

1 Answers1

0

I don't think it's possible to do it the way you describe. Last I checked, apps can only write inside their sandbox dir and cannot read inside other apps' sandboxes (though IIRC there used to be a few other writable directories).

What, exactly, is the end result you are trying to achieve?

If you know the app you want to read the data, you can use a custom URL scheme.

If you have a file of a certain type (extension/content-type, I think), you can use UIDocumentInteractionController to let the user pick an app to open it in.

If you just want to share some data with any app, the closest I can think of is a custom UIPasteboard. OpenUDID does this for a slightly dubious purpose.

tc.
  • 33,468
  • 5
  • 78
  • 96
  • thanks for reply tc - to see what I am trying to achieve overall see this question I posted on SO - http://stackoverflow.com/questions/12539243/openurl-a-local-file-or-force-uidocumentinteractioncontroller-to-use-a-specific – lifeIsGood Sep 22 '12 at 22:55
  • tc - I am wondering if your suggestiong about using UIPasteboard might work - Ive been looking around and can't find anything - but do you know of any example regarding using UIPasteboard with .zip files and/or using openURL on something already saved in the UIPasteboard?? Thanks – lifeIsGood Sep 22 '12 at 23:52
  • You still haven't mentioned what you *actually want to achieve* by doing this, but iOS does not seem to be designed to pass large amounts of data between apps like you seem to want to do. You could run a webserver in your app and pass the link to the other app - you'll need to make your app run in the background to send the file over. – tc. Sep 23 '12 at 00:03
  • I just received an answer from Apple Tech support and they told me that this is currently impossible (just after iOS 6 released) – lifeIsGood Sep 27 '12 at 02:07