我的应用可让您使用iTunes录制和分享录音。我继续在AppDelegate.m
中使用此方法将数据库移动到另一个文件夹 - (NSURL *)applicationDocumentsDirectory
{
NSString *libraryPath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) lastObject];
NSString *path = [libraryPath stringByAppendingPathComponent:@"Private Documents"];
NSURL *pathURL = [NSURL fileURLWithPath:path];
BOOL isDirectory = NO;
if ([[NSFileManager defaultManager] fileExistsAtPath:path isDirectory:&isDirectory]) {
if (isDirectory) {
return pathURL;
} else {
[NSException raise:@"'Private Documents' exists, and is a file" format:@"Path: %@", path];
}
}
NSError *error = nil;
if (![[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error]) {
[NSException raise:@"Failed creating directory" format:@"[%@], %@", path, error];
}
return pathURL;
}
我的应用在Info.plist中将UIFileSharingEnabled键设置为true。一切似乎都很完美,但这是我收到的回应:
我们发现您的应用未按要求实现营销材料或发行说明中所述的核心功能 App Store评论指南。
您的应用将UIFileSharingEnabled键设置为true Info.plist,但此功能不起作用。
启用文件共享时,将使用整个Documents文件夹 文件共享。不打算通过文件进行用户访问的文件 共享功能应存储在应用程序的另一部分中 束。如果您的应用程序不需要文件共享功能, 不应将Info.plist中的UIFileSharingEnabled键设置为 真。
对于离散的代码级问题,您可能希望咨询Apple 开发人员技术支持请务必:
- 包含拒绝问题的完整详情
- 准备任何符号化的崩溃日志,屏幕截图和步骤,以重现DTS工程师跟进时的问题。
有关如何表示和阅读崩溃日志的信息,请参阅 技术说明TN2151了解和分析iPhone OS应用程序 崩溃报告。
如果您在复制此问题时遇到困难,请尝试测试 如上所述的工作流程 https://developer.apple.com/library/ios/qa/qa1764/技术问答 QA1764:如何重现仅App App或用户的崩溃或错误 正在看。
如何解决此问题? 谢谢大家。
答案 0 :(得分:0)
问题是您将UIFileSharingEnable标记为True,但未正确使用它。
他们写道,您可能正在尝试共享文件,用户不允许访问,这可能是您的主要问题。
无论如何,如果您只是尝试共享记录到iTunes,您可以使用此代码并尝试根据您的请求进行修改:
你应该把它放在AppDelegte文件中。
NSString *fileName = @"your_file_name";
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *documentDBFolderPath = [documentsDirectory stringByAppendingPathComponent:fileName];
if (![fileManager fileExistsAtPath:documentDBFolderPath])
{
NSString *resourceDBFolderPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:fileName];
[fileManager copyItemAtPath:resourceDBFolderPath toPath:documentDBFolderPath error:&error];
}
我帮你了
感谢。
答案 1 :(得分:0)
我遇到同样的问题,当我在app Store上传我的应用程序时,解决方案是根据本教程链接通过iTunes实现fileSharing-
http://www.raywenderlich.com/1948/how-integrate-itunes-file-sharing-with-your-ios-app
希望它对你有所帮助。
快乐编码,:)
答案 2 :(得分:0)
在我的情况下,我的应用被拒绝,因为在应用说明中没有介绍功能。只需编辑并重新提交即可。
希望这可以提供帮助。