【发布时间】:2015-02-20 00:04:19
【问题描述】:
我正在使用表视图控制器将当前用户的友谊关系添加到类似于用户表中另一个用户的行。 我找不到将所选行设置为变量的方法,在这种情况下,该对象将被称为 user。我目前的方式在 objectAtIndex 部分引发了错误。
var relation : PFRelation = PFUser.currentUser().relationForKey("friendship")
let user:PFObject = self.userArray.objectAtIndex(indexPath.row) as PFObject
relation.addObject(user)
PFUser.currentUser().saveInBackgroundWithBlock { (succeed:Bool, error: NSError!) -> Void in
if error != nil {
NSLog("Unable to save")
}
}
我查看了许多教程,他们似乎也是这样做的。 任何帮助都会很棒,谢谢
【问题讨论】:
标签: ios swift parse-platform xcode6