IOS your app stores 18.79MB on the user's iCloud 应用被拒问题,
来源:互联网 发布:mac pretty boy 编辑:程序博客网 时间:2024/05/29 09:15
亲测自己查阅资料解决,其实也不怎么难= =,好了,直接说解决思路。很简单,直接让iCloud 忽略 document的目录 不备份就可以了。没错,思路就是这么简单。
下面是苹果官方的方法 https://developer.apple.com/library/prerelease/content/qa/qa1719/_index.html
下面是我自己的代码:
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions{ //解决2.1.1被拒问题,忽略document文件放置iCloud备份 NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); if (paths.count > 0) { NSLog(@"NSDocumentDirectory paths = %@",paths[0]); [self addSkipBackupAttributeToItemAtPath:paths[0]]; } return YES;}
/** * 跳过iCloud 存储 * * @param filePathString app的url * * @return */- (BOOL)addSkipBackupAttributeToItemAtPath:(NSString *) filePathString{ NSLog(@"%s",__func__); NSURL* URL= [NSURL fileURLWithPath: filePathString]; 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;}
第二段代码是苹果官方的,用NSURLIsExcludedFromBackupKey or kCFURLIsExcludedFromBackupKey 这两个文件系统属性把文件从备份文件中排除。
我忽略的是document 的路径,相应的总结一下其他 文件的路径 = =,可忽略
//1,获取家目录路径的函数:NSString *homeDir = NSHomeDirectory();//2,获取Documents目录路径的方法:NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);NSString *docDir = [paths objectAtIndex:0];//3,获取Caches目录路径的方法:NSArray *paths2 = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);NSString *cachesDir = [paths2 objectAtIndex:0];//4,获取tmp目录路径的方法:NSString *tmpDir = NSTemporaryDirectory();//5,获取应用程序程序包中资源文件路径的方法://例如获取程序包中一个图片资源(apple.png)路径的方法:NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"apple" ofType:@"png"];UIImage *appleImage = [[UIImage alloc] initWithContentsOfFile:imagePath];//代码中的mainBundle类方法用于返回一个代表应用程序包的对象。
下面是参考的博客 :
http://blog.csdn.net/wm9028/article/details/50293139
http://blog.csdn.net/shanglanxin/article/details/50395583
http://www.cnblogs.com/lzlsky/p/3333139.html
0 0
- IOS your app stores 18.79MB on the user's iCloud 应用被拒问题,
- 关于 Details On launch and content download, your app stores 15.83MB on the user's iCloud被拒问题
- Hacking the App Stores
- Apple And Google’s App Stores Now Neck And Neck – Except On The Metric That Matters Most To Develope
- icloud -- Testing Your CloudKit App -- Deploying the Schema
- iOS 上传应用到Appstore遇到的问题 Your app is using the Advertising Identifier (IDFA)
- Running the app on your device
- How to use user’s location in your app?
- iOS 2.3.7 Your app name to be displayed on the 
- 【iOS】Could not launch Verify the Developer App certificate for your account is trusted on your devic
- iCloud配置问题(iOS 支持iCloud)
- Buying your way into the App Store’s Top 25
- iTunes升级 如何获取app stores 应用连接
- Instruments User Guide编程指南5-Profile Your App's Memory Usage
- Verify the Developer App certificate for your account istrusted on your device.
- Verify the Developer App certificate for your account is trusted on your device
- Verify the Developer App certificate for your account istrusted on your device.
- Mobile App Stores
- java中的锁池和等待池 (r)
- SolrJ
- B-spline Curves 学习之B样条曲线性质(5)
- JAVA设计模式之单例模式
- 分布式缓存技术redis学习系列(一)——redis简介以及linux上的安装以及操作redis问题整理
- IOS your app stores 18.79MB on the user's iCloud 应用被拒问题,
- jvm内存溢出解决办法
- Java中的异常 Exception
- B-spline Curves 学习之B样条曲线的系数计算与B样条曲线特例(6)
- IOS 之 NSURL的一些基本操作
- A few ways to tell Git which files to ignore.
- 设计模式C++版:第六式迭代器模式
- 浅谈IQKeyboardManager第三方库的使用
- MySql(17)------IF,CASE,LOOP,LEAVE,ITERATE,REPEAT,WHILE流程控制语句