2017-08-28 97 views
0

在使用parse-server(在Heroku/mLab上)的iOS应用程序中,我遇到以下云功能问题。 下面是相关代码:无法将...转换为期望的参数类型'PFIdResultBlock?'

PFCloud.callFunction(inBackground: "myCloudFunction", 
         withParameters: ["lastTouch" : theLastTouchStamp]) { 
          (any: Any, error: Error) in 
          print("Now Inside Block (myCloudFunction)") 
    } 

以下是错误信息,我从编译器获得:

Cannot convert value of type '(Any, Error) ->()' to expected argument type 'PFIdResultBlock?' 

我浏览过网上搜索了一些资料,但eventhough我发现一对夫妇的相关帖子;没有什么能让我找到解决办法。

有人知道如何解决这个问题吗?

回答

1

从封闭中取出类型:

PFCloud.callFunction(inBackground: "myCloudFunction", withParameters: ["lastTouch" : theLastTouchStamp]) { 
    (value, error) in 

    print("Now Inside Block (myCloudFunction)") 
} 
+0

这工作,那就是简单。非常感谢! – Michel

相关问题