title: Swift: Extra argument 'error' in call
body: <p>I'm currently developing my first iOS app using Swift 2.0 and Xcode Beta 2. It reads an external JSON and generates a list in a table view with the data. However, I'm getting a strange little error that I can't seem to fix: </p>
  
  <pre><code>Extra argument 'error' in call
  </code></pre>
  
  <p>Here is a snippet of my code:</p>
  
  <pre><code>let task = session.dataTaskWithURL(url!, completionHandler: {data, response, error -&gt; Void in
              print("Task completed")
  
              if(error != nil){
                  print(error!.localizedDescription)
              }
  
              var err: NSError?
  
              if let jsonResult = NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.MutableContainers, error: &amp;err) as? NSDictionary{
  
                  if(err != nil){
                      print("JSON Error \(err!.localizedDescription)")
                  }
  
                  if let results: NSArray = jsonResult["results"] as? NSArray{
                      dispatch_async(dispatch_get_main_queue(), {
                          self.tableData = results
                          self.appsTableView!.reloadData()
                      })
                  }
              }
          })
  </code></pre>
  
  <p>The error is thrown at this line:</p>
  
  <pre><code>if let jsonResult = NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.MutableContainers, error: &amp;err) as? NSDictionary{
  </code></pre>
  
  <p>Can someone please tell me what I'm doing wrong here?</p>