2
我写了一个使用Parse.com的iOS应用程序。当我需要更改关于用户的信息时,我使用refreshInBackgroundWithBlock
。我现在正在为Mac OS X编写应用程序,但我似乎无法使用refreshInBackgroundWithBlock
。有什么建议么?Parse.com刷新用户信息
以下是下面的代码。
//Refresh the User Info
currentUser.refreshInBackgroundWithBlock { (object, error) -> Void in
//Fetch the User Info
currentUser.fetchIfNeededInBackgroundWithBlock { (result, error) -> Void in
//Check if the comments read is nil
if object.objectForKey("commentsRead") === nil {
println("Comments Read is empty")
} else {
var currentRead:[Int] = []
//If not empty assign the array to the value
currentRead = object.objectForKey("commentsRead") as Array
currentRead.append(0)
var user = PFUser.currentUser()
user.setObject(currentRead, forKey: "commentsRead")
user.saveInBackgroundWithBlock { (result, error) -> Void in
println("Completed!")
}
}
Parse的文档说了什么? – nhgrif 2015-04-05 23:35:20
iOS和OSX似乎是一样的。在Mac上,我看到''PFUser'没有名为'refreshInBackgroundWithBlock'的成员。 – 2015-04-05 23:36:45
我强烈建议实际发布您的实际代码,这是产生错误。 – nhgrif 2015-04-05 23:37:45