title: Invalid top-level type in JSON write
body: <p>I'm trying to create a simple JSON object but I still get error and I know what's wrong in my code:</p>
  
  <pre><code>NSString *vCard = [BRContacts getContacts]; // this is just a string, could be nil
  NSDictionary *JSONdic = nil;
  if (vCard)
  {
      JSONdic = [NSDictionary dictionaryWithObjectsAndKeys:@"1",@"status",vCard,@"data", nil];
  }
  else
  {
      JSONdic = [NSDictionary dictionaryWithObjectsAndKeys:@"0",@"status",@"vCard is empty",@"error", nil];
  }
  NSError *error = nil;
  NSData *JSONData = [NSJSONSerialization dataWithJSONObject:JSONdic options:NSJSONWritingPrettyPrinted error:&amp;error];
  return [GCDWebServerDataResponse responseWithJSONObject:JSONdata];
  </code></pre>
  
  <p>The exception is</p>
  
  <blockquote>
    <p>Invalid top-level type in JSON write</p>
  </blockquote>
  
  <p>I checked also <code>JSONdic</code> and it's not nil in every case.
  Any suggestions?</p>