PFObject在Xcode 6.0.1,Yosemite GM3中没有名为'saveInBackground'的成员 [英] PFObject does not have a member named 'saveInBackground' in Xcode 6.0.1, Yosemite GM3

查看:85
本文介绍了PFObject在Xcode 6.0.1,Yosemite GM3中没有名为'saveInBackground'的成员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Parse在Yosemite中表现得非常奇怪,saveInBackground声称自己不是PFObject的成员。

Parse is acting very strangely in Yosemite, saveInBackground claims to not be a member of PFObject.

var score = PFObject(className: "score")
    score.setObject("Mo", forKey: "name")
    score.setObject(1, forKey: "scoreCount")
    score.saveInBackground()

显然这应该有效,也许这是Xcode 6.0.1或Yosemite GM3(或组合)的问题。为了清楚起见,使用saveInBackgroundWithBlock工作正常。

Clearly this should work, perhaps it's an issue with Xcode 6.0.1 or Yosemite GM3 (Or a combination). To be clear, using saveInBackgroundWithBlock works fine.

还有其他人遇到过这个或类似奇怪的错误吗?

Has anyone else experienced this or a similarly weird bug?

推荐答案

在标头中声明 saveInBackground 方法以返回 BFTask * 对象,这是Bolts框架的一部分。确保您的项目链接Bolts框架,然后添加

The saveInBackground method is declared in the header to return a BFTask * object, which is part of the Bolts framework. Make sure your project is linking the Bolts framework, and then add

#import <Bolts/Bolts.h>

到你的桥接头。

这个为我解决了Swift中的一些缺失API(这个,以及 PFAnalytics.trackAppOpenedWithLaunchOptions 在这里提到:为什么我的PFAnalytics没有trackAppOpeneWithLaunchOptions功能?(IOS SWIFT)

This solved a few "missing" APIs in Swift for me (this one, as well as PFAnalytics.trackAppOpenedWithLaunchOptions mentioned here: Why does my PFAnalytics not have trackAppOpeneWithLaunchOptions function? (IOS SWIFT)

这篇关于PFObject在Xcode 6.0.1,Yosemite GM3中没有名为'saveInBackground'的成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆