【问题标题】:iOS15 B4 NSPersistentCloudKitContainer "Account Temporarily Unavailable" ErroriOS15 B4 NSPersistentCloudKitContainer“帐户暂时不可用”错误
【发布时间】:2021-10-04 00:14:24
【问题描述】:

我在 iOS15 beta 4 上使用 NSPersistentCloudKitContainer 跨设备同步核心数据。在设备上启动并登录 iCloud 时,我在日志中收到以下错误:

成功: 0 madeChanges: 0 错误:

我有以下代码:

init(inMemory: Bool = false) {
        container = NSPersistentCloudKitContainer(name: "AppName")
        if inMemory {
            let storeDescription = NSPersistentStoreDescription(url: URL(fileURLWithPath: "/dev/null"))
            container.persistentStoreDescriptions = [storeDescription]
        } else {
            let storeURL = URL.storeURL(for: "my.app.group", databaseName: "AppName")
            let storeDescription = NSPersistentStoreDescription(url: storeURL)
            storeDescription.cloudKitContainerOptions = NSPersistentCloudKitContainerOptions(containerIdentifier: "iCloud.my.app")
            container.persistentStoreDescriptions = [storeDescription]
        }
        
        container.loadPersistentStores(completionHandler: { (storeDescription, error) in
            if let error = error as NSError? {
                fatalError("Unresolved error \(error), \(error.userInfo)")
            }
        })
    }

【问题讨论】:

    标签: ios swift cloudkit nspersistentcloudkitcontainer


    【解决方案1】:

    这似乎是 beta 4 中引入的一个错误 - https://developer.apple.com/forums/thread/685857

    【讨论】:

      【解决方案2】:

      正如@ryannnn 指出的那样,seems to be fixed in beta 5 似乎是一个错误。 我在公共 CK 数据库中遇到了类似的问题。如果我可以确认 b5 为我修复了它,我将对其进行编辑...

      编辑:它确实解决了Account Temporarily Unavailable 问题。但是,iCloud 同步仍然只发生在应用安装后的第一个会话中。再次运行时,安装后我仍然得到<CKError 0x281fe43f0: "Server Rejected Request" (15/2027); server message = "Custom zones are not allowed in public DB"; op = *****; uuid = ***-***-***>

      【讨论】:

      • 你能解决这个问题吗?我遇到了同样的问题。 iCloud 同步一开始确实有效,但后来出现了相同的错误消息。
      猜你喜欢
      • 2021-10-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多