i have here a swift 2 with parse.com code
the problem is the code printing // 2 before //1 that make a problem i can not use the array in other methods or other places here is the code
var myStudent:Student = Student ()
let query = PFQuery(className: "Students")
query.findObjectsInBackgroundWithBlock { (objects: [AnyObject]?, error:NSError?) -> Void in
var the_array = objects as! AnyObject
for i in 0...the_array.count-1
{
myStudent.NameStudent = the_array[i].valueForKey("name") as! String
self.myStudentsArray.append(myStudent)
print(self.myStudentsArray.count) //1
}
}
print(self.myStudentsArray.count) //2