2.23:应用必须遵循iOS数据存储指南,否则将被拒绝 [英] 2.23: Apps must follow the iOS Data Storage Guidelines or they will be rejected

查看:127
本文介绍了2.23:应用必须遵循iOS数据存储指南,否则将被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过将应用程序上传到应用程序商店,我发现了这个错误。

By uploading the app to the app store have given me this error.


2.23:应用必须遵循iOS数据存储指南,否则将被拒绝

2.23: Apps must follow the iOS Data Storage Guidelines or They Will be rejected

我一直在看错了我正在使用的其中一个文件不符合存储要求。

I've been watching what is wrong is that one of the files I'm using does not meet the storage requirements.

更具体地说,它是一个用于使用route-me库加载地图离线模式的sqlite。

To be more specific it is a sqlite for loading maps offlines mode with route-me library.

我在离线模式下使用sqlite加载地图,似乎这张地图在iCloud中存储为备份,所以我正在跳过存储限制。

I am using sqlite for loading map in offline mode, it seems that this map is stored as backup in iCloud, so I'm skipping storage restrictions.

不知道如何说这个副本不是在iCloud中创建的。

Do not know how to say that this copy is not created in iCloud.

代码如下:

[[RMDBMapSource alloc] initWithPath: @ "map.sqlite"]; 

文件大小为23MB

任何想法?

推荐答案

很可能你将map.sqlite存储在应用程序的Documents目录中。 Sqlite文件通常被复制到Documents目录,以便它们是可写的。但是,默认情况下,iOS会尝试将Documents目录中的所有文件复制或备份到iCloud(如果启用了iCloud备份)。因此,根据Apple的指导原则,您可以执行以下操作,以便iCloud不从您的Documents目录备份您的数据库文件。

Most probably you are storing your "map.sqlite" in your application's Documents directory. Sqlite files are normally copied to Documents directory so that they are writable. But iOS, by default, tries to copy or backup all the files in Documents directory to iCloud (if iCloud backup is turned on). Therefore, according to Apple's guidelines, you can do the following so that your database file is not backed up by iCloud from your Documents directory.

您可以调用以下函数将map.sqlite的路径作为NSURL传递:

You can call the following function to pass the path of your "map.sqlite" as NSURL:

NSURL *url = [NSURL fileURLWithPath:yourSQLitePath];
[self addSkipBackupAttributeToItemAtURL:url];

该功能在 Apple

- (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;
}

此功能可确保不备份文件(以URL提供)通过iCloud。

This function makes sure that the file (provided as URL) is not backed up by iCloud.

您还可以将数据库文件放在Documents目录中的单独目录中,并通过调用此函数将整个子目录标记为不备份。希望它有所帮助。

You can also put your database files in a separate directory inside Documents directory and mark that whole subdirectory as 'do not backup' by calling this function. Hope it helps.

这篇关于2.23:应用必须遵循iOS数据存储指南,否则将被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆