title: Error Domain=NSCocoaErrorDomain Code=256 "The file “...” couldn’t be opened."
body: <p>When I open a URL (like this <code>http://webserver/index.php/feeds/1.2/3.4/5/1000/</code>) in my app via Xcode I get a nil JSON string returned. It doesn't even seem to be talking to the server.</p>
  
  <p>The exact same URL works when I paste it into a browser. </p>
  
  <p>Reading up on similar problems, I tried restarting my Mac and iPhone but I get the same problem.</p>
  
  <p>e.g. looking at the error object I see:</p>
  
  <pre><code>Error Domain=NSCocoaErrorDomain Code=256 "The file “1000” couldn’t be opened." UserInfo={NSURL=http://webserver/index.php/feeds/1.2/3.4/5/1000/} 
  </code></pre>
  
  <p>The webserver does not show any entries in the logs (it does if I paste the URL in the browser) when I'm running the app and go past that line of code.</p>
  
  <p>==== UPDATE</p>
  
  <p>I'm assuming it's something to do with this <a href="https://stackoverflow.com/questions/30739473/nsurlsession-nsurlconnection-http-load-failed-on-ios-9/30836686#30836686">NSURLSession/NSURLConnection HTTP load failed on iOS 9</a></p>
  
  <p>However, after adding the webservice domain to the plist (under NSExceptionDomains) I get a crash in CJSONDserializer in this method:</p>
  
  <pre><code>- (id)deserializeAsDictionary:(NSData *)inData error:(NSError **)outError;
  {
  if (inData == NULL || [inData length] == 0)
  </code></pre>
  
  <p>as follows:</p>
  
  <pre><code>Thread 4: EXC_BAD_ACCESS (code=1,address=0x10)
  </code></pre>
  
  <p>and, after updating TouchJSON, I now have a crash here:</p>
  
  <pre><code>if (theData.length &gt;= 4)
  </code></pre>
  
  <p>==== UPDATE 2</p>
  
  <p>Interestingly, if I click the QuickLook icon in Xcode whilst on the breakpoint, it loads up the content just fine. And I can see a request at the server.</p>
  
  <p>Any suggestions?</p>