title: Converting a Dictionary with a value of [NSNull null] to JSON
body: <p>I am trying to use this code:</p>
  
  <pre><code>NSDictionary *innerMessage 
        = @{@"nonce":[NSNumber numberWithInteger:nonce],
            @"payload":@{@"login": [NSNull null]}};
  
  NSError * err;
  NSData * innerMessageData = [NSJSONSerialization 
       dataWithJSONObject:innerMessage options:0  
       error:&amp;err];
  </code></pre>
  
  <p>to create a <code>JSON</code> object with the following structure:</p>
  
  <pre><code>{
      "apikey": "e418f5b4a15608b78185540ef583b9fc",
      "signature": "FN6/9dnMfLh3wZj+cAFr82HcSvmwuniMQqUlRxSQ9WxRqFpYrjY2xlvDzLC5+qSZAHts8R7KR7HbjiI3SzVxHg==",
      "message":{
          "nonce": 12, 
          "payload": {
              "Login": {}
          }
      }
  }
  </code></pre>
  
  <p>However, this is the actual result which I get:</p>
  
  <pre><code>{"nonce":1398350092512,"payload":{"login":null}}
  </code></pre>
  
  <ul>
  <li>Why is <code>[NSNull null]</code> in my dictionary not being converted to <code>{}</code>?</li>
  <li>How would I need to change my code to get the correct <code>JSON</code>
  structure?</li>
  </ul>
  
  <p>Thank you!</p>