title: Cocoa Error 3840 - NSJSONSerialization
body: <p>I'm trying to parse a JSON string returned from a ASP.NET web service.  The return string has been simplified to just this:</p>
  
  <pre><code>&lt;anyType d1p1:type="q1:string"&gt;[{"Firstname":"Johnny"}]&lt;/anyType&gt;
  </code></pre>
  
  <p>When I run the following code in xcode, I get an error of "Error Domain=NSCocoaErrorDomainCode=3840"..."JSON text did not start with array or object and option to allow fragments are not set"</p>
  
  <pre><code>NSURL *url = [NSURL URLWithString:@"http://webserver.com/Service.asmx/GetNames"];
      NSData *data = [NSData dataWithContentsOfURL:url];
        if(data != nil)
          {
              NSError *error = nil;
              id result = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&amp;error];
                  if(error == nil)
          {
              NSLog(@"%@", result);
          }else{
              NSLog(@"%@",error);
          }
      }else{
          NSLog(@"it's nil");
      }
  </code></pre>
  
  <p>I'm not really sure what to do here?  The error seems to be on the "id result =" line.</p>
  
  <p>*I thought it might be the format of my reutrn string, but everything i read on ASP.NET posts says this is correct.</p>
  
  <p>*I have changed "NSJSONReadingMutableContainers" to be "NSJSONReadingMutableLeves"</p>