title: tableView is not showing data from JSON in swift
body: <p>I am parsing JSON data from <a href="http://api.feedzilla.com/v1/categories.json" rel="nofollow noreferrer">HERE</a>.</p>
  <p>for that I have used this code.</p>
  <p><strong>DataManager.swift</strong></p>
  <pre><code>import Foundation
  
  let TopAppURL = &quot;http://api.feedzilla.com/v1/categories.json&quot;
  
  class DataManager {
  
  class func getTopAppsDataFromItunesWithSuccess(success: ((iTunesData: NSData!) -&gt; Void)) {
      //1
      loadDataFromURL(NSURL(string: TopAppURL)!, completion:{(data, error) -&gt; Void in
          //2
          if let urlData = data {
              //3
              success(iTunesData: urlData)
          }
      })
  }
  
  class func loadDataFromURL(url: NSURL, completion:(data: NSData?, error: NSError?) -&gt; Void) {
  var session = NSURLSession.sharedSession()
  
  // Use NSURLSession to get data from an NSURL
  let loadDataTask = session.dataTaskWithURL(url, completionHandler: { (data: NSData!, response: NSURLResponse!, error: NSError!) -&gt; Void in
    if let responseError = error {
      completion(data: nil, error: responseError)
    } else if let httpResponse = response as? NSHTTPURLResponse {
      if httpResponse.statusCode != 200 {
        var statusError = NSError(domain:&quot;com.raywenderlich&quot;, code:httpResponse.statusCode, userInfo:[NSLocalizedDescriptionKey : &quot;HTTP status code has unexpected value.&quot;])
        completion(data: nil, error: statusError)
      } else {
        completion(data: data, error: nil)
      }
    }
  })
  
  loadDataTask.resume()
   }
  }
  </code></pre>
  <p>and <strong>ViewController.swift</strong></p>
  <pre><code>import UIKit
  
  class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
  
  var i = 0
  var detailid = [Int]()
  var detailCat = [String]()
  var tableData = [&quot;1&quot;,&quot;2&quot;,&quot;3&quot;]
  
  @IBOutlet weak var tableView: UITableView!
  override func viewDidLoad() {
  super.viewDidLoad()
  
  DataManager.getTopAppsDataFromItunesWithSuccess { (iTunesData) -&gt; Void in
      
      let json = JSON(data: iTunesData)
      
      if let array = json.arrayValue{
  
          for Dict in array{
              var id : Int = array[self.i][&quot;category_id&quot;].integerValue!
              var category : String = array[self.i][&quot;english_category_name&quot;].stringValue!
              self.detailid.append(id)
              self.detailCat.append(category)
              
              self.i++
              
          }
          println(self.detailid)
          println(self.detailCat)
      }
  }
  
  
  }
  
  func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int{
      
      return self.detailCat.count
  }
  
  
  func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell{
      
      var cell = tableView.dequeueReusableCellWithIdentifier(&quot;Cell&quot;) as UITableViewCell
      cell.textLabel.text = self.detailCat[indexPath.row]
      return cell
      
     }
  
  }
  </code></pre>
  <p>In console I am getting data like:</p>
  <pre><code>[1314, 13, 21, 22, 5, 588, 6, 17, 25, 1168, 11, 14, 2, 28, 15, 33, 591, 20, 29, 36, 3, 10, 16, 18, 8, 34, 4, 27, 30, 31, 26, 23, 12, 7, 590, 9, 19]
  [Sports, Art, Blogs, Business, Celebrities, Columnists, Entertainment, Events, Fun Stuff, General, Health, Hobbies, Industry, Internet, IT, Jobs, Law, Life Style, Music, Oddly Enough, Politics, Products, Programming, Religion And Spirituality, Science, Shopping, Society, Sports, Technology, Top Blogs, Top News, Travel, Universities, USA, Video, Video Games, World News]
  </code></pre>
  <p>but It is not printing it into <code>tableView</code>.</p>
  <p>what I am missing? please help me for this.</p>