数据不能....格式不正确

时间:2018-04-23 03:46:08

标签: ios swift parse-server

我在使用Parse-Server的Swift iOS应用程序中有以下代码。

func theWiftFunction() {
    PFCloud.callFunction(inBackground: "myCloudFunction",
                         withParameters: ["unitID": somePFObject.value(forKey: "objectId")!,
                                          "userID": (PFUser.current()?.objectId)!]) {
                                            (object: Any?, error: Error?) in
                                            if error != nil {
                                                if error?.localizedDescription == "NO-UNIT"
                                                {print("The given unit has not been found for this user. This should not happen.")}
                                                else {print("Error in \(#function)\n" + (error?.localizedDescription)!)}
                                                return
                                            }
                                            // All is OK!!
                                          };
    .......
}

部分工作正常,但在某些情况下我收到此错误消息:

Error in theWiftFunction()
The data couldn’t be read because it isn’t in the correct format.

问题是:为什么数据,有时是正确的格式,有时不是?我该怎么做才能得到“正确的格式”?

0 个答案:

没有答案