问题描述
我没有使用任何 icloud 存储空间
I did not use any icloud storage
原因 2.23:应用必须遵循 iOS 数据存储指南,否则将被拒绝----- 2.23 -----我们发现您的应用程序没有遵循iOS 数据存储指南,这是App Store 审核指南所要求的.特别是,我们发现在启动和/或内容下载时,您的应用程序存储 21.12 MB.要检查您的应用程序存储了多少数据:- 安装并启动您的应用程序- 转到设置 >iCloud >存储&备份 >管理存储 - 如有必要,点击显示所有应用" - 检查您应用的存储iOS 数据存储指南指出,只有用户使用您的应用创建的内容,例如文档、新文件、编辑等,应该由 iCloud 备份.您的应用程序使用的临时文件应仅存储在/tmp 目录中;请记住在用户退出应用程序时删除存储在此位置的文件.可以重新创建但必须保留以使应用程序正常运行的数据 - 或者因为客户希望它可用于离线使用 - 应标记为不备份"属性.对于 NSURL 对象,添加 NSURLIsExcludedFromBackupKey
属性以防止备份对应的文件.对于 CFURLRef 对象,使用相应的 kCFURLIsExcludedFromBackupKey
属性.有关更多信息,请参阅技术问答 1719:如何防止文件被备份到 iCloud 和 iTunes?.
Reasons 2.23: Apps must follow the iOS Data Storage Guidelines or they will be rejected----- 2.23 -----
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 21.12 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
The iOS Data Storage Guidelines indicate that only content that the user creates using your app, e.g., documents, new files, edits, etc., should be backed up by iCloud.
Temporary files used by your app should only be stored in the /tmp directory; please remember to delete the files stored in this location when the user exits the app.
Data that can be recreated but must persist for proper functioning of your app - or because customers expect it to be available for offline use - should be marked with the "do not back up" attribute.
For NSURL objects, add the NSURLIsExcludedFromBackupKey
attribute to prevent the corresponding file from being backed up. For CFURLRef objects, use the corresponding kCFURLIsExcludedFromBackupKey
attribute.
For more information, please see Technical Q&A 1719: How do I prevent files from being backed up to iCloud and iTunes?.
离线存储数据到Sqlite我的功能是
To Store data offline into Sqlite my function is
+ (NSString*)saveImageInDocuments:(UIImage*)senderImage {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSDate *selected = [NSDate date];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"ddmmyyyyhhmmss"];
NSString *imgName = [dateFormat stringFromDate:selected];
imgName = [NSString stringWithFormat:@"%@.jpg",imgName];
NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent:imgName];
UIImage *image = senderImage;
NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation(image)];
[imageData writeToFile:savedImagePath atomically:YES];
NSLog(@"path is... %@",savedImagePath);
return imgName;
}
为了从 sqlite 离线获取数据,我正在使用这个函数
And to get data offline from sqlite i am using this function
+ (UIImage*)getImageFromDocuments:(NSString*)senderImageName {
NSString *documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *getImagePath = [documentsDirectory stringByAppendingPathComponent:senderImageName];
NSFileManager *fileManager = [NSFileManager defaultManager];
BOOL fileExist = [fileManager fileExistsAtPath:getImagePath]; // Returns a BOOL
UIImage *img = [[UIImage alloc] init];
if(fileExist)
{
img = [[UIImage alloc] init];
img = [UIImage imageWithContentsOfFile:getImagePath];
}
NSLog(@"path is... %@",getImagePath);
return img;
}
推荐答案
您必须为不想在 iCloud 上同步的文件设置一个标志.默认为 iOS 同步.如果设备设置允许,iCloud 上的应用数据.
You have to set a flags for files which you don't want to sync on iCloud. By default iOS Sync. app data on iCloud if device settings allow it.
使用此方法从备份中跳过文件
Use this method to skip files from backup
- (BOOL)addSkipBackupAttributeToItemAtURL: (NSURL *)URL {
float version = [[[UIDevice currentDevice] systemVersion] floatValue];
if (version > 5.0) {
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;
}
return NO;
}
[self addSkipBackupAttributeToItemAtURL:[[NSURL alloc] initFileURLWithPath:"YOURFILEPATH"]];
这篇关于为什么我的应用程序被 appstore 拒绝,尽管我没有使用 icloud的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!