title: Updating array value using find object in the background is swift
body: <p>I'm trying to retrieve data from Parse using <code>findObjectsInbackground</code> and store it in an array. I've already created outside the scoop of <code>viewDidLoad()</code>.
  I managed retrieving and printing the data, but they are not stored in the array and it keeps being empty! 
  I used <code>self.articalsTableView.reloadData()</code> but unfortunately the array <code>myArray</code> is still empty.</p>
  
  <p>Any help please, this has been confusing me for two days!</p>
  
  <pre><code>import UIKit
  import Parse
  
  class FirstViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
  
      @IBOutlet weak var articalsTableView: UITableView!
  
      var myArray = [PFObject]()
  
  override func viewDidLoad() {
          super.viewDidLoad()
  
  let query = PFQuery(className: "Gateshead")
          query.findObjectsInBackground {(objects, error) -&gt; Void in
              if error !=  nil {
                  print(error)
              } else {
                  if let articals = objects {
  
                      for artical in articals {
                     // print (articles)   THIS IS WOKING WELL
  
                          self.myArray.append(artical)
                          self.articalsTableView.reloadData()
                      } 
                  } 
              }
          }     
      }
  }
  </code></pre>