PFQuery没有拿起变量

时间:2016-01-07 14:15:33

标签: swift parse-platform

用户在textField中输入文本,然后我想要一个Parse Query来根据该字段获得一些结果。我是“KVC语法挑战”!所以我想知道在Parse过滤器中我需要什么代码来获取newText var。提前感谢任何可以帮助我的人......

 func wordEntered(alert: UIAlertAction!){
        // store the new word
        newText = newWordField.text! as String
        // query Parse
        getList()
    }

  func getList() {
    let query = PFQuery(className: "WordList")
    query.whereKey("SharingCode", equalTo: "@\(newText)") // NOT PICKING UP newText??

    query.findObjectsInBackgroundWithBlock { (objects:[PFObject]?, error:NSError?) -> Void in
        if error == nil && objects != nil {
                for object in objects! {
                 // process the objects
        } else {
            print("Error")
        }
    }
}

0 个答案:

没有答案
相关问题