Sandbox issue

I’m hoping someone can help me with this.

I have an app that takes a single image and slices it into several images. These slices are then saved in an ordered sequence.

So far so good.

During testing, everything worked perfectly, so in preperation for the Xojo fix that will allow us to upload to the App Store again, I decided to code sign and sandbox it, using App Wrapper.

Now, the app will not save the image slices. I have enabled ALL of the sandbox options and tried to save the files in several locations, but I always get the following error:

The Problem Report states:

[quote]Process: Image Slicer [3773]
Path: /Users/USER/*/Image Slicer.app/Contents/MacOS/Image Slicer
Identifier: com.krazypengwingames.imageslicer
Version: 1.0 (1.0.0.3.29)
Code Type: X86 (Native)
Parent Process: launchd [424]
Responsible: Image Slicer [3773]
User ID: 501

Date/Time: 2014-01-04 20:00:03.421 +0000
OS Version: Mac OS X 10.9.1 (13B42)
Report Version: 11
Anonymous UUID: 83C18018-29E6-2BCE-99A8-7AF530A335F4

Sleep/Wake UUID: 875E7215-2571-40EA-AA1E-B5E8374EA818

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000018
[/quote]

Has anyone else encountered this? If so, is there a way to fix it? Or am I doing something wrong?

Where have you tried to save the images?
A sandboxed app an only save files to it’s container or to a user selected folder.

The user does select the folder, using the save as dialog.

But, I just thought, as I am changing the filenames, in order to change the sequence, would that cause the issue?

[quote=57067:@Mark Oxley]The user does select the folder, using the save as dialog.

But, I just thought, as I am changing the filenames, in order to change the sequence, would that cause the issue?[/quote]

You can only save what the user selected, including the name. You cannot change the name.

If you need to save your sequence, why not save it in Application Data

dim f as folderitem = SpecialFolder.ApplicationData.child("yourapp").child("filename")

In a sandboxed app, it will save in a special container where you can save and later read all the files you need.

If the user selects a [b]folder/b and not a save location for a file, you can write what files you want into that selected folder :slight_smile:

Thanks Albin, that would work perfectly. I’ll try that when I get into work tomorrow.

Just ran a quick test with the SelectFolderDialog, and it works! :slight_smile:

Thanks for your help guys.