title: NSURLErrorDomain error code 1002 description
body: <p>I am new to <strong>iOS</strong> development. I am trying to load a <strong>JSON</strong>, here's my function:</p>
  <pre><code>func loadmyJSON (urlPath: String) {      
  
      let url: NSURL = NSURL(string: urlPath)!
  
      let session = NSURLSession.sharedSession()
  
      let task = session.dataTaskWithURL(url, completionHandler: {data, response, error -&gt; Void in
                 println(&quot;Task completed&quot;)
          if(error != nil) {
              // If there is an error in the web request, print it to the console
              println(&quot;error not nil::::::&quot;)
              println(error.localizedDescription)
          }
          var err: NSError?
          
          var jsonResult = NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.MutableContainers, error: &amp;err) as NSDictionary
          if(err != nil) {
              // If there is an error parsing JSON, print it to the console
              println(&quot;JSON Error \(err!.localizedDescription)&quot;)
      }
      
          
          let results: NSArray = jsonResult[&quot;variants&quot;] as NSArray
                      dispatch_async(dispatch_get_main_queue(), {
              
              self.jsonTable = results
              self.productView!.reloadData()
             })
       })
  </code></pre>
  <p>But I am getting this error:</p>
  <blockquote>
  <p><code>error not nil::::::</code></p>
  <p><code>The operation couldn’t be completed. (NSURLErrorDomain error -1002.)</code></p>
  </blockquote>
  <p>I am able to get the JSON in the browser through the same URL.
  I have tried reading <a href="https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Constants/Reference/reference.html" rel="noreferrer">this Apple Doc</a>, but I can't get the description.</p>
  <p>What does this error code mean?</p>