3

我们陷入了审查过程。

Apple 审阅者说我们没有为应用程序中需要的文件设置“不备份”标志。

当然,我们第一次确实忘记了用该标志标记文件。但第二次我们使用这里描述的方法http://developer.apple.com/library/ios/#qa/qa1719/_index.html

但它没有工作,该应用程序再次被拒绝。

一次又一次地调试和尝试,文件永远不会被标记为“不备份”,使用 Apple 说我们需要在 iOS 5.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;

}

但是,如果我们使用他们说我们需要在 iOS 5.0.1 中使用的方法,则文件会被很好地标记并且不会在 iCloud 中备份。

#import <sys/xattr.h>

- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL

{

    assert([[NSFileManager defaultManager] fileExistsAtPath: [URL path]]);



    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;

}

但问题是苹果的文档页面说这种方法已被弃用。因此,我担心我们使用有效的方法(适用于 iOS 5.0.1 的方法)再次上传应用程序,并且可能会针对同一问题再次拒绝该应用程序。

所以文档说一件事,但这件事不能正常工作。

有人解决了这个问题吗?苹果评论家并没有告诉我们这个问题以及如何解决,以便我们可以 100% 符合预期。

4

0 回答 0