gpt4 book ai didi

ios - Apple 第二次拒绝了我的应用

转载 作者:行者123 更新时间:2023-11-29 10:36:48 25 4
gpt4 key购买 nike

我创建了一个应用程序,但苹果拒绝了两次,因为我没有遵循 iOS 数据存储指南,我很惊讶,因为我已经提交了没有任何问题的应用程序,我正在使用 sqlite 来存储我的数据,并且我正在将图像存储到文档目录中以及他们进入数据库的路径,我已经做了什么

- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL
{
const char* filePath = [[URL path] fileSystemRepresentation];

const char* attrName = "com.apple.MobileBackup";
u_int8_t attrValue = 1;

int result = setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 0, 0);
return result == 0;
}

-(void) copyDatabaseIfNeeded {

//Using NSFileManager we can perform many file system operations.
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error;
NSString *dbPath = [self getDBPath];
BOOL success = [fileManager fileExistsAtPath:dbPath];

if(!success) {
NSString *defaultDBPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:databaseName];
success = [fileManager copyItemAtPath:defaultDBPath toPath:dbPath error:&error];

[self addSkipBackupAttributeToItemAtURL:[NSURL URLWithString:dbPath]];

if (!success)
NSAssert1(0, @"Failed to create writable database file with message '%@'.", [error localizedDescription]);
}
}

-(void)connectWithDB
{
[self copyDatabaseIfNeeded];
[self generateDB];
}

在我的 booldidfinishWithLaunchingOption 函数中我做了

[self connectWithDB];

我不知道他们为什么有问题,

We found that your app does not follow the iOS Data Storage Guidelines, which is required per the App Store Review Guidelines.

In particular, we found that on launch and/or content download, your app stores 2.5 MB. To check how much data your app is storing:

Install and launch your app
Go to Settings > iCloud > Storage & Backup > Manage Storage
If necessary, tap "Show all apps"
Check your app's storage

最佳答案

您使用的是旧方法。使用 this document 中描述的较新方法

- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL
{
assert([[NSFileManager defaultManager] fileExistsAtPath: [URL path]]);

NSError *error = nil;
BOOL success = [URL setResourceValue: [NSNumber numberWithBool: YES]
forKey: NSURLIsExcludedFromBackupKey error: &error];
if(!success){
NSLog(@"Error excluding %@ from backup %@", [URL lastPathComponent], error);
}
return success;
}

关于ios - Apple 第二次拒绝了我的应用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26481972/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com