title: Populating Table Cells With Alamofire Data
body: <p>For the better part of the day, I've been attempting to play with Alamofire and use it to gather some API-based data to populate a table.  I've successfully managed to get the data into my iOS app (I can println to see it), but I cannot for the life of me figure out the context to use my data to populate the correct number of table rows and set a label.</p>
  
  <p>My data from the web is like so;</p>
  
  <pre><code>{
  "members": [
      "Bob Dole",
      "Bill Clinton",
      "George Bush",
      "Richard Nixon",
      ]
  }
  </code></pre>
  
  <p>My TableViewController has code like so;</p>
  
  <pre><code>...
  var group: String?
  var memberArr = [String]()
  var member: [String] = []
  ...
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      func getData(resultHandler: (data: AnyObject?) -&gt; ()) -&gt; () {
      Alamofire.request(.GET, "http://testurl/api/", parameters: ["groupname": "\(group!)"])
          .responseJSON { (_, _, JSON, _) in
              let json = JSONValue(JSON!)
              let data: AnyObject? = json
              let memberArr:[JSONValue] = json["members"].array!
              for obj in json["members"] {
                  let member = obj.string!
              }
              resultHandler(data: data)
          }
      }
  ...
  
  
  
  ...
  override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
      return memberArr.count
  }
  ....
  </code></pre>
  
  <p>My return memberArr.count does not work</p>
  
  <p>What I cannot figure out, however, is how to get my "member" variable to be accessible throughout the controller, as I'd like to use it to return the proper number of rows or use the list of members to dynamically set the title of each cell.</p>
  
  <p>I know this is a novice question, but I've dug through StackOverflow and none of the questions seem to fit in to my situation.</p>
  
  <p>Thank you in advance!</p>