title: ios swift parse: get data out of parse and use them
body: <p>I find only in the docs how the query can look like to select data.
  As far as I see, there is only one way to collect 1 or many results:</p>
  
  <pre><code>var query = PFQuery(className:"GameScore")
  query.whereKey("playerName", equalTo:"Sean Plott")
  query.findObjectsInBackgroundWithBlock {
    (objects: [AnyObject]!, error: NSError!) -&gt; Void in
    if error == nil {
      // The find succeeded.
      NSLog("Successfully retrieved \(objects.count) scores.")
      // Do something with the found objects
      for object in objects {
          NSLog("%@", object.objectId)
      }
    } else {
      // Log details of the failure
      NSLog("Error: %@ %@", error, error.userInfo!)
    }
  }
  </code></pre>
  
  <p>What I cant figure out (as I am a beginner!) is how to access the object data. Lets say I have the fields "name", how can I get it? What is the right syntax? Especially if I have more than 1 result?</p>
  
  <p>For just one result I would do:</p>
  
  <pre><code>var name = object["name"] as String
  myArray.append(name)
  </code></pre>
  
  <p>Even that can't be right? To use "var xx = xx" within the loop?</p>
  
  <p>And what do I do when I have more than one result?</p>
  
  <p>Other thought:
  Declaring the var name: String! before I do the query and then:</p>
  
  <pre><code>name = object["name"] as String
  self.myArray.append(name)
  </code></pre>
  
  <p>Returns the error: Immutable vaue of type [String] only has mutating members named 'append'</p>
  
  <p>What would be the correct way to "work" with the data the query returns?</p>
  
  <p>Another question: as those querys are async, they finished later and the method is "done" much more earlier, this way my array with names is empty when the view is shown and I receive the data at a later stage. What is the best practice here to have all data available before the view is delivered to the device?</p>
  
  <p>Thanks so much!!</p>