gpt4 book ai didi

ios - 如何使用 NSURLIsExcludedFromBackupKey 或 kCFURLIsExcludedFromBackupKey?

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:23:52 24 4
gpt4 key购买 nike

我的应用被拒绝了,因为我将应用内购买数据保存在 iPhone 的文档文件夹中。

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.

但我希望用户即使离线也能使用数据,所以我将使用 kCFURLIsExcludedFromBackupKeyNSURLIsExcludedFromBackupKey。它们有什么区别?

问题是如何使用它们中的任何一个,它会返回什么以及我如何使用这些返回的数据?

最佳答案

NSError *error = nil;

BOOL result = [fileURL setResourceValue:[NSNumber numberWithBool:YES] forKey:NSURLIsExcludedFromBackupKey error:&error];

关于ios - 如何使用 NSURLIsExcludedFromBackupKey 或 kCFURLIsExcludedFromBackupKey?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10121165/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com