ios - 解析不会编译

标签 ios xcode swift parse-platform

所以我只是想用解析来设置我的新应用程序。我已经下载了他们的 SDK 并粘贴了我的 applicationID。问题出在推送通知(我什至没有碰过)。有人可以帮帮我吗? 谢谢

错误代码:

   PFPush.subscribeToChannelInBackground("") { (succeeded: Bool, error: NSError?) in
        if succeeded {
            print("ParseStarterProject successfully subscribed to push notifications on the broadcast channel.\n");
        } else {
            print("ParseStarterProject failed to subscribe to push notifications on the broadcast channel with error = %@.\n", error)
        }
    }
}

它说:

Cannot invoke 'subscribeToChannelInBackground' with an argument list of type '(String, (Bool, NSError?) -> ())'

最佳答案

您显示的代码是订阅通知 channel ...并且它提示它不期望这些参数类型。

要设置 Parse SDK,请按照以下步骤操作:https://www.parse.com/apps/quickstart#parse_data/mobile/ios/swift/existing

根据解析入门指南,这就是他们测试安装是否良好(快速)的方式

let testObject = PFObject(className: "TestObject")
testObject["foo"] = "bar"
testObject.saveInBackgroundWithBlock { (success: Bool, error: NSError?) -> Void in
  print("Object has been saved.")
}

关于ios - 解析不会编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34898551/

相关文章:

ios - UIScrollView : Not filling width of container? 内嵌套的 UIStackViews

ios - UITextField 边框在左侧和底部不同

iphone - 查看 Xcode 中调用了哪些方法

ios - 如何在 Xcode 中调试 EXC_BREAKPOINT (SIGTRAP)

xcode - 选择 Xcode 6 Beta 时 UITabBarItem 图像消失

swift - 使用组合时的代码共享

ios - 带有node js的部分内容视频流到IOS

ios - SKSpriteNode 在随机路径上的平滑运动

swift - Type Any 不符合协议(protocol) Sequence

ios - 如何让 Swift 循环无限期(永远)运行?