title: Swift 2.0 : Json Array Parsing errors
body: <p>in Swift 1.2 </p>
  
  <blockquote>
    <p><a href="https://gist.github.com/anonymous/a167148a8a6d169292ff" rel="nofollow">https://gist.github.com/anonymous/a167148a8a6d169292ff</a></p>
  </blockquote>
  
  <p>in Swift 2.0 (error)
  , so I change my code as follows.</p>
  
  <pre><code>let url = NSURL(string:"http://dl-8.one2up.com/onetwo/content/2015/6/15/9c3b51249fbbe20ca9d841401e276d97.php")
      let allContactsData = NSData(contentsOfURL:url!)
  
      do{
          var allContacts : AnyObject! = try NSJSONSerialization.JSONObjectWithData(allContactsData!, options: NSJSONReadingOptions())
      }catch{
      print(error)
      }
  
      if let json = allContacts as? Array&lt;AnyObject&gt;  {
      print(json)
  
  
          for index in 0...json.count-1 {
  
              let contact : AnyObject? = json[index]
  
              let collection = contact! as! Dictionary&lt;String, AnyObject&gt;
  
              let name : AnyObject? = collection["AnimeName"]
              let cont : AnyObject? = collection["Episodes"]
  
              names.append(name as! String)
              episodes.append(cont as! String)
          }
  
      }
      print(names)
      print(episodes)
  </code></pre>
  
  <p>But that doesn't work. </p>
  
  <blockquote>
    <p>if let json = allContacts as? Array&lt; AnyObject ></p>
  </blockquote>
  
  <p>error : Use of unresolved identifier 'allContacts'</p>