简体   繁体   中英

Strange error with CloudKit query

I am getting a very generic error for a CloudKit query. I am not sure how to fix it. Does anyone have any suggestions?

The error is <CKError 0x17065c230: "Internal Error" (1/2005)> Error occurred. Error = <CKError 0x174648370: "Internal Error" (1/2005)> <CKError 0x17065c230: "Internal Error" (1/2005)> Error occurred. Error = <CKError 0x174648370: "Internal Error" (1/2005)>

My code is:

    override func viewDidLoad() {
    super.viewDidLoad()
    let database = CKContainer.defaultContainer().publicCloudDatabase
    let container = CKContainer.defaultContainer()
    let publicDB = container.publicCloudDatabase
    let data = CKRecord(recordType: "theUsers")

    var predicate = NSPredicate(value: true)
    let myQuery = CKQuery(recordType: "theUsers", predicate: predicate)

    var mySelfie = matchedSelfie

    publicDB.performQuery(myQuery, inZoneWithID: nil) {
        results, error in
        if error != nil {
            println(error)

        } else {
            for record in results{
                if let aselfie = record.stringForKey("selfie") { //Optional binding
                    mySelfie.append(aselfie) //Append to string array

                    mySelfie.append(aselfie)
                    return ()
                }

            }}}

}

I got the same error. You can get more information by looking at the iCloud Steps section in the Capabilities tab of your project:

  1. In the Project Navigator, select your project
  2. Select your Target
  3. Select Capabilities
  4. Expand the iCloud section
  5. Assuming you have the CloudKit service enabled, you should see a list of steps you must perform. (Eg Add the "iCloud" entitlement to your App ID.)

More likely than not, at least one of those shows a red error icon instead of a checkmark.

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM