为什么跳过for循环?

时间:2015-12-23 07:52:05

标签: ios swift parse-platform

我试图获取一个等于名称的某一行的数组,但由于某种原因,for循环被跳过了。我放了一个断点,但断点永远不会被调用。

 let query = PFQuery(className: "Tutors")
    query.whereKey("name", equalTo: self.name.text!)
    query.findObjectsInBackgroundWithBlock ({
        (objects: [PFObject]?, error: NSError?) -> Void in
        if(error == nil){
        for object in objects!{
            //placed break point on line below, program does not stop on breakpoint.
            let arr = object["Subject"] as? [String]

                self.subject = arr!

             print("subjects\(self.subject)")

            }
        }else{
            print(error)
        }
    })

1 个答案:

答案 0 :(得分:0)

Name中,当您在name中使用query.whereKey("name", equalTo: self.name.text!)时,您的专栏名为var audio = new Audio("Assets/Tune/A#.mp3") 。把钥匙大写,你就应该好。