我的申请被苹果拒绝了,原因是:
2.23:应用程序必须遵循 iOS 数据存储指南,否则将被拒绝
那么是否有可能将整个 Document 目录标记为没有备份?我的应用程序在 iOS 6.1 和更高版本中运行。
我熟悉这段代码,但我不知道用它来标记我的文档目录
- (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;
}
编辑:
Apple 告诉我 iCloud 会从图片库备份我的照片,我会像这样加载图库的图片:
- (void)setupPageScroll {
NSString *imgCount;
int i;
[_scrollView setContentSize:CGSizeMake(_scrollView.frame.size.width * _pageControl.numberOfPages, _scrollView.frame.size.height)];
_scrollView.delegate = self;
for (i = 0 ; i < 10 ; i++) {
imgCount = [NSString stringWithFormat:@"%@%d.jpg",_gallName , i];
[self createPageWithImage:[UIImage imageNamed:imgCount] forPage:i];
}
}
- (void)createPageWithImage:(UIImage *)images forPage:(int)page
{
UIView *newView = [[UIView alloc] initWithFrame: CGRectMake(_scrollView.frame.size.width * page, 0, _scrollView.frame.size.width, _scrollView.frame.size.height)];
UIImageView *tempImage = [[UIImageView alloc]initWithImage:images];
[tempImage setContentMode:UIViewContentModeScaleAspectFit];
tempImage.frame = _galleryView.frame;
_imgGallery = tempImage;
[newView addSubview: _imgGallery];
[_scrollView addSubview: newView];
}
- (IBAction)pageChanged:(id)sender {
CGRect pageRect = CGRectMake(_pageControl.currentPage * _scrollView.frame.size.width, 0, _scrollView.frame.size.width, _scrollView.frame.size.height);
[_scrollView scrollRectToVisible: pageRect animated: YES];
}
怎么能跳过这些图像?