I'm using an NSSavePanel
in my app. Everything works fine on my OS X 10.7, but the application was rejected by Apple, with the following comment:
When exporting for the second time, the previously selected save location does not work. The user has to unselect the location and then select it again in order to have the file written. Please ensure that you have the necessary entitlements.
This review was conducted on an iMac running OS X 10.8.
This is my save panel code:
NSSavePanel *savePanel = [NSSavePanel savePanel];
[savePanel setAllowedFileTypes:[NSArray arrayWithObject:@"mov"]];
[savePanel setDirectoryURL:[NSURL URLWithString:@"/Documents"]];
[savePanel setNameFieldStringValue: videoName];
[savePanel beginSheetModalForWindow:window completionHandler:^(NSInteger result){
if (result == NSFileHandlingPanelOKButton) {
NSError *error = nil;
NSString *sourceFilePath = [NSString stringWithFormat:@"%@/%@",[[NSBundle mainBundle] resourcePath], videoName];
NSString *destFilePath = [[savePanel URL] path];
NSFileManager *fileManager = [[NSFileManager alloc] init];
if(![fileManager copyItemAtPath:sourceFilePath toPath:destFilePath error:&error])
NSLog(@"%@", error);
}
}];
Currently I'm using these flags:
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.assets.movies.read-write</key>
<true/>
<key>com.apple.security.files.downloads.read-write</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
</dict>
What entitlement flag do I have to use to solve this issue?