Mad*_*n89 5 iphone app-store ios
我是iOS开发的新手.我的应用程序被拒绝了审核,说明以下原因,
2.23应用必须遵循iOS数据存储指南,否则将被拒绝
我们发现您的应用不符合iOS数据存储指南,这是根据App Store审核指南所要求的.
我没有将我的DB文件存储在文档目录中.这是我的代码,
NSString *libraryPath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) lastObject];
NSString *path = [libraryPath stringByAppendingPathComponent:@"DatabaseFolder"];
NSURL *pathURL = [NSURL fileURLWithPath:path];
BOOL isDirectory = NO;
if ([[NSFileManager defaultManager] fileExistsAtPath:path isDirectory:&isDirectory]) {
if (isDirectory) {
return pathURL;
} else {
// Handle error. ".data" is a file which should not be there...
[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;
Run Code Online (Sandbox Code Playgroud)
如何重现只有App Review或用户看到的崩溃或错误?
iOS数据存储指南文档需要登录才能查看)说:
\n\n\n\n\napp\xe2\x80\x99s 主目录中的所有内容都会备份,但应用程序包本身、缓存目录和临时目录除外。
\n
这意味着即使是你的NSLibraryDirectory目录内容也会备份到 iCloud。要解决此问题,您有以下选择,
以下是如何将资源标记为不备份到 iCloud。
\n\n- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL\n{\n assert([[NSFileManager defaultManager] fileExistsAtPath: [URL path]]);\n\n NSError *error = nil;\n BOOL success = [URL setResourceValue: [NSNumber numberWithBool: YES]\n forKey: NSURLIsExcludedFromBackupKey error: &error];\n if(!success){\n NSLog(@"Error excluding %@ from backup %@", [URL lastPathComponent], error);\n }\n return success;\n}\nRun Code Online (Sandbox Code Playgroud)\n\n希望有帮助!
\n| 归档时间: |
|
| 查看次数: |
475 次 |
| 最近记录: |