Real Software Forums
http://forums.realsoftware.com/

sandbox and delete
http://forums.realsoftware.com/viewtopic.php?f=7&t=47174
Page 1 of 1

Author:  lajdesign [ Tue Mar 05, 2013 10:52 pm ]
Post subject:  sandbox and delete

I have an app that converts text to MP3 that is in the app store and just sandboxing. I am running into an issue with sandbox where I can't delete the MP3 made the run before. Should I just come up with a rename process if the file exists or is there an easy way to delete files?

Thanks

Luke

Author:  rowlands [ Wed Mar 06, 2013 7:24 am ]
Post subject:  Re: sandbox and delete

lajdesign wrote:
I have an app that converts text to MP3 that is in the app store and just sandboxing. I am running into an issue with sandbox where I can't delete the MP3 made the run before. Should I just come up with a rename process if the file exists or is there an easy way to delete files?

Thanks

Luke


This may be a security-scoped bookmark issue, in which case you'll need to retain a bookmark to the file, then request access to it before you try to delete it. If I'm right, you won't even be able to rename the file without access.

Author:  Kuzey [ Wed Mar 06, 2013 2:26 pm ]
Post subject:  Re: sandbox and delete

rowlands wrote:
This may be a security-scoped bookmark issue, in which case you'll need to retain a bookmark to the file, then request access to it before you try to delete it. If I'm right, you won't even be able to rename the file without access.


Just wondering, do you need a bookmark for each file or can you just have one for the parent folder?

Kuzey

Author:  lajdesign [ Wed Mar 06, 2013 8:44 pm ]
Post subject:  Re: sandbox and delete

Any examples of how to do security-scoped bookmarks?

Author:  rowlands [ Wed Mar 06, 2013 8:54 pm ]
Post subject:  Re: sandbox and delete

lajdesign wrote:
Any examples of how to do security-scoped bookmarks?

Take a look at my sample project at http://www.ohanaware.com/appwrapper/SandboxableApplication.zip, specifically the sandboxSafeRecentItems.

You must request access everytime you want to anything with the file, and you must release it as soon as you're done, otherwise the Sandbox will lock access again and you won't be able to open it until your application is restarted.

Author:  rowlands [ Wed Mar 06, 2013 8:58 pm ]
Post subject:  Re: sandbox and delete

Kuzey wrote:
rowlands wrote:
This may be a security-scoped bookmark issue, in which case you'll need to retain a bookmark to the file, then request access to it before you try to delete it. If I'm right, you won't even be able to rename the file without access.


Just wondering, do you need a bookmark for each file or can you just have one for the parent folder?

Kuzey

You should be able to bookmark a folder, although Apple do prefer files (document packages are acceptable). I have an app in development that does bookmark folders, we'll see later this year if Apple will accept it.

Author:  lajdesign [ Wed Mar 06, 2013 9:57 pm ]
Post subject:  Re: sandbox and delete

Thanks Sam for all your hard work.

Luke

Author:  rowlands [ Wed Mar 06, 2013 10:20 pm ]
Post subject:  Re: sandbox and delete

lajdesign wrote:
Thanks Sam for all your hard work.

Luke

No worries - I had to do it for our own apps, and I've seen a great deal of people have to go through the same thing, so I though I'd share it.

Author:  Kuzey [ Sat Mar 09, 2013 5:04 pm ]
Post subject:  Re: sandbox and delete

Thanks Sam!

Keep us updated :)

Kuzey

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/