4
votes

I use iCloud file sync behind the scenes to keep instances of my Mac application in sync so I have the entitlement set for that. Unfortunately, this means that iCloud also appears as a possible save location when I invoke NSSavePanel.

Because my app does not generate files that are intended to be reused or reimported back into my app, I have no iCloud open panel. However my app does allow the user to export simple HTML or CSV reports. I don't expect a reasonable user to choose iCloud as their save destination when exporting reports in my app, but Apple has now flagged this as a reason to reject the app since they conceivably could do that and then those files are effectively stranded in the cloud.

How can I suppress iCloud from the potential options when the user goes to save a file?

2

2 Answers

1
votes

My app was also rejected for being able to save exported documents to iCloud. I specified in the note to the reviewer that it wasn't reasonable to save to iCloud, but they rejected it a second time. I asked about sample code on the review feedback, and on Apple's developer board, and got no response. Finally I gave up and just turned off iCloud support. It's convenient, but not necessary.

If you create a document in TextEdit, and export to PDF in iCloud, you create a file that TextEdit can't open. (Preview can.) By Apple's own rules, TextEdit should be rejected.

0
votes

If you are using iCloud at all and have a save panel then iCloud will be an option as a save location. Hopefully that will be optional in the future, but for now my solution is to add an 'Open' option in my App Menu that allows my app to open my saved files with the system default application for that item.

For example, my app allows users to save reports as txt files. So when they go to open them again in iCloud they open in TextEdit.

It's a simple method that you can add to your AppDelegate and link to the 'Open' menu item.

- (IBAction)openDocument:(id)sender {
    NSOpenPanel *openPanel = [[NSOpenPanel alloc] init];
    if ([openPanel runModal] == NSOKButton)
    {
        NSURL *aFilePath = [[openPanel URLs] objectAtIndex:0];
        NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
        [workspace openURL:aFilePath];
    }
}