问题描述
由于不备份原因导致申请被拒绝
我尝试了一件事来解决此问题。我从Apple技术支持获得了一个小代码,并根据iOS guideLines在我的项目中使用了此代码。首先,我在 appdelegate.m
部分中添加了一个头文件
I tried one thing to remove this issue. I got one small code from Apple technical support and used this code in my project according to iOS guideLines. First, I added a header file in my appdelegate.m
part
#import<sys/xattr.h>
然后粘贴以下功能。
- (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;
}
并在完成启动时将上述函数调用到我的appdelegate。
And call the above function to my appdelegate when it finishes launching.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
[self addSkipBackupAttributeToItemAtURL:[NSURL URLWithString:@"<Application_Home>/Library/Caches"]];
[self addSkipBackupAttributeToItemAtURL:[NSURL URLWithString:@"<Application_Home>/tmp"]];
[self addSkipBackupAttributeToItemAtURL:[NSURL URLWithString:@"<Application_Home>/Library/Private Documents"]];
}
现在我只是想知道这是否正常。我可以在上重新上传我的应用程序吗?
Now I just want to know if this OK or not. Can I reupload my application on iTunes Connect or not?
推荐答案
我找到了解决这个问题的方法。我们不应该保留任何大型内存数据库。
为了解决这个问题,我删除了所有放在 db.sqlite
中的图像( db.sqlite
是我的数据库名称)。现在我已经创建了一个新的 db.sqlite
。在这里我只保留了图像名称,图像保存在我的项目文件夹中。
I have found a solution regarding this issue. We should not keep any large memory database.For removing this issue, I removed all the images which were placed in db.sqlite
(db.sqlite
is my database name). Now I have made a new db.sqlite
. In this I have kept only images names, and images are kept in my project folder.
如果您的应用程序中有一个繁重的数据库,那么您将必须遵循。
现在Apple接受我的申请,并获得批准。 : - )
If you have a heavy database in your applications then you will have to follow iCloud.Now Apple accepts my application, and it got approved. :-)
另请阅读本文 - 数据存储指南
-
无法重新创建的关键数据(例如,如果设备损坏将丢失的文档或用户特定数据)将进入< Application_Home> / Documents目录,并将由iCloud备份,除非否则指定。
Critical data that cannot be recreated, such as documents or user-specific data that would be lost if the device were damaged, goes into the <Application_Home>/Documents directory and will be backed up by iCloud unless otherwise specified.
可以重新创建的缓存数据(例如本地数据库或下载的图像)进入< Application_Home> / Library / Caches目录,不会被iCloud支持。如果iOS磁盘空间不足,可能会在某些时候清除此数据。
Cached data that can be recreated, such as a local database or downloaded images, goes into the <Application_Home>/Library/Caches directory and will not be backed up by iCloud. This data may get purged at some point if iOS runs low on disk space.
临时数据是暂时的,在应用程序启动之间不会使用,例如临时文件缓存,进入< Application_Home> / tmp目录,不会被iCloud备份。您应该始终记得自己删除存储在此处的文件。
Temporary data that is transient and not used between application launches, such as a temporary file cache, goes into the <Application_Home>/tmp directory and will not be backed up by iCloud. You should always remember to delete files stored here yourself.
当设备离线(例如飞行模式)时需要持久且可用的离线数据,进入< Application_Home> / Library / Private Documents目录并且不会被iCloud备份,但在低磁盘空间情况下它也不会被iOS清除。有关iOS中私人文档的更多信息。
Offline data that needs to be persistent and available when the device is offline (such as Airplane Mode), goes into the <Application_Home>/Library/Private Documents directory and will not be backed up by iCloud, but also it will not be purged by iOS in a low disk space situation. For more information about Private Documents in iOS.
这篇关于Apple开发人员因“不备份”而拒绝iPhone应用程序原因。现在我该怎么做?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!