我从解析文档中复制了这个,但在最后一行不断收到错误“PFPush 没有名为 sendPushInBackground 的成员”。我不知道为什么
let pushQuery = PFInstallation.query()
pushQuery.whereKey("deviceType", equalTo: "ios")
let push = PFPush()
push.setQuery(pushQuery) // Set our Installation query
push.setMessage("Willie Hayes injured by own pop fly.")
push.sendPushInBackground()
最佳答案
来自 PARSE DOC:v1.2.21 — 2014 年 8 月 22 日
“从这个版本开始,您需要将 Bolts.framework
(和 ParseFacebookUtils.framework,如果您的应用程序与 Facebook SDK 交互)拖到您的 Xcode 项目文件夹目标中。两者都位于 Parse SDK 下载中。”
因此,如果您在 Swift 中使用它...在您拖动 Bolt 框架之后,您还必须添加这个“#import”
#import <Bolts/Bolts.h>
在你的...-Bridging-Header.h
编码愉快!
关于ios - 无法弄清楚为什么我收到错误 "PFPush does not have a member named sendPushInBackground",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28562623/