0

如果我只是下载启动项目,在 xcode 6.3 中打开它,更新 setApplicationID 行并运行它,正如它在快速启动屏幕上所说的那样,我得到错误

无法使用类型为“(字符串,块:(布尔,NSError!)-> Void)”的参数列表调用“subscribeToChannelInBackground”

在 AppDelegate.swift 中。

最新版本的 Swift 或/和 Xcode 有问题还是我错过了什么?

4

1 回答 1

1

正如 RaVeN 所说, NSError 在 Swift 1.2 中已更改为可选。因此,转到发生错误的地方,subscribeToChannelInBackground。

改变这个:

        PFPush.subscribeToChannelInBackground("", block: { (succeeded: Bool, error: NSError!)

对此:

        PFPush.subscribeToChannelInBackground("", block: { (succeeded: Bool, error: NSError?)

您现在应该可以毫无问题地进行编译。

于 2015-04-19T02:06:17.810 回答