【发布时间】:2015-08-26 08:42:14
【问题描述】:
这就是我使用objectId 检索用户信息的方式:
func loadData() {
userId = toPass
data.removeAllObjects()
var profileQuery:PFQuery = PFUser.query()!
profileQuery.whereKey("objectId", equalTo: userId)
profileQuery.getObjectInBackgroundWithId(userId, block: { (objects, error) -> Void in
if error == nil {
self.data.addObject(objects!)
println(self.data) //...shouldn't be empty here
} else {
println("Error retrieving user: \(error) ")
}
})
}
override func viewDidLoad() {
super.viewDidLoad()
loadData()
fullName.text = self.data["fullName"] as! String! // ***** error here.. cannot assign a value of type 'String' to a value of type 'String?'
}
viewDidLoad 中有错误。知道我哪里错了吗?感谢您的宝贵时间。
【问题讨论】:
标签: ios swift parse-platform pfquery