由于我需要NSSavePanel的临时权利,应用程序被拒绝

时间:2013-07-13 04:43:20

标签: xcode macos appstore-approval appstore-sandbox entitlements

这是我的Mac应用程序第二次被MAS拒绝。 我使用临时授权,以便用户可以将他的备份文件存储在他的设备上创建的应用程序中。 这是我从MAS到我拒绝的回应:

We've determined that one or more temporary entitlement exceptions requested for 
this app are not appropriate and will not be granted:

com.apple.security.temporary-exception.files.home-relative-path.read-write  / 

非常模糊,第二次他们没有告诉我我在做什么有什么问题。

为此,我使用以下权利:

<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<string>True</string>
<key>com.apple.security.temporary-exception.files.home-relative-path.read-write</key>
<array>
    <string>/</string>
</array>

这就是我使用权利的方式:

NSSavePanel* saveSelection = [NSSavePanel savePanel];

[saveSelection setPrompt:@"Export"];
[saveSelection setMessage:NSLocalizedString(@"Save your encrypted backup file to:",@"")];
[saveSelection setNameFieldStringValue:date];

[saveSelection beginSheetModalForWindow:kDelegate.window completionHandler:^(NSInteger result) {
if (result==NSFileHandlingPanelOKButton)
    {....
    }
}

我真的希望有人可以提前帮助和感谢!

1 个答案:

答案 0 :(得分:1)

我终于通过将其添加到NSSavePanel来实现它:

[saveSelection setAllowedFileTypes:[NSArray arrayWithObject:@"whatever"]];
[saveSelection setAllowsOtherFileTypes:NO];

我不知道为什么这会让它发挥作用,但它确实......至少在我的应用程序中。

相关问题