为什么对象id没有被恢复?

时间:2015-11-10 18:17:18

标签: ios swift parse-platform

我正在尝试获取用户的对象ID。用户字符串为friendusername。 打印objectid: []

时,objectid为空白
 override func viewWillAppear(animated: Bool) {
    print(friendusername)
     var query = PFUser.query()
    let objId = query!.whereKey("username", equalTo: friendusername)
    print(objId)
    query!.getFirstObjectInBackgroundWithBlock{
        (userobject: PFObject?, error: NSError?) -> Void in
        if error == nil{
            var objectid = userobject?.objectId
            print("objectid: \(objectId)")
            print(error)
        }else{
            print(error)
        }
    }


}

0 个答案:

没有答案