gpt4 book ai didi

addPersistentStoreWithType 的 iOS 核心数据 + iCloud 错误 : You don’t have permission to save the file “store” in the folder

转载 作者:搜寻专家 更新时间:2023-11-01 07:26:39 24 4
gpt4 key购买 nike

我从头开始创建了一个核心数据项目,我所做的唯一改变是在持久协调器添加存储的地方,我提供了一个 NSPersistentStoreUbiquitousContentNameKey 选项:

coordinator.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: url, options: [NSPersistentStoreUbiquitousContentNameKey : "coreDataiCloudTestStore"])

我在启动时插入并保存一个新的托管对象。

启动时没有 iCloud 帐户登录,没有问题。当应用程序运行时,我正在登录 iCloud 并返回到应用程序。我收到此错误:您无权在文件夹中保存文件“store”,不允许操作:

CoreData: error: -addPersistentStoreWithType:SQLite configuration:PF_DEFAULT_CONFIGURATION_NAME URL:file:///var/mobile/Containers/Data/Application/9032B2BC-BE8B-42C9-A9CC-EF3E01AA6F2B/Documents/SingleViewCoreData.sqlite options:{ NSPersistentStoreUbiquitousContentNameKey = coreDataiCloudTestStore; PFUbiquitySetupSynchronousSideLoadKey = 1; }

... returned error Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “store” in the folder “380E290C-97F9-4DC3-9B3C-43322FCA455D”." UserInfo={NSFilePath=/var/mobile/Containers/Data/Application/9032B2BC-BE8B-42C9-A9CC-EF3E01AA6F2B/Documents/CoreDataUbiquitySupport/mobile~C5A2ECE3-1AB9-45FA-9C15-037DCCA054DE/coreDataiCloudTestStore/380E290C-97F9-4DC3-9B3C-43322FCA455D/store, NSUnderlyingError=0x1453f430 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}} with userInfo dictionary { NSFilePath = "/var/mobile/Containers/Data/Application/9032B2BC-BE8B-42C9-A9CC-EF3E01AA6F2B/Documents/CoreDataUbiquitySupport/mobile~C5A2ECE3-1AB9-45FA-9C15-037DCCA054DE/coreDataiCloudTestStore/380E290C-97F9-4DC3-9B3C-43322FCA455D/store"; NSUnderlyingError = "Error Domain=NSPOSIXErrorDomain Code=1 \"Operation not permitted\""; }

PFUbiquitySwitchboardEntry containerIdentifierChanged:: CoreData: Ubiquity: Error loading new temporary coordinator after account change with options { { NSPersistentStoreUbiquitousContentNameKey = coreDataiCloudTestStore; } } and URL file:///var/mobile/Containers/Data/Application/9032B2BC-BE8B-42C9-A9CC-EF3E01AA6F2B/Documents/SingleViewCoreData.sqlite and error = Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “store” in the folder “380E290C-97F9-4DC3-9B3C-43322FCA455D”." UserInfo={NSFilePath=/var/mobile/Containers/Data/Application/9032B2BC-BE8B-42C9-A9CC-EF3E01AA6F2B/Documents/CoreDataUbiquitySupport/mobile~C5A2ECE3-1AB9-45FA-9C15-037DCCA054DE/coreDataiCloudTestStore/380E290C-97F9-4DC3-9B3C-43322FCA455D/store, NSUnderlyingError=0x1453f430 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}

为什么会这样?

最佳答案

从 iCloud 重建

To remove local data and start fresh with the existing records in iCloud, pass the NSPersistentStoreRebuildFromUbiquitousContentOption option with a value of @YES when you add your iCloud-enabled persistent store to the persistent store coordinator. Include any iCloud options you usually include.

关于addPersistentStoreWithType 的 iOS 核心数据 + iCloud 错误 : You don’t have permission to save the file “store” in the folder,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35686967/

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