title: Converting an NSArray of Dictionaries to JSON array in iOS
body: <p>I need to send an <code>NSArray</code> to the server in the <code>JSON</code> array format. How can I convert it to <code>JSON</code>. This is a sample of my <code>NSArray</code> that I have to pass.</p>
  
  <pre><code>array([0] =&gt; array('latitude'=&gt;'10.010490', 
                    'longitude'=&gt;'76.360779', 
                     'altitude'=&gt;'30.833334', 
                    'timestamp'=&gt;'11:17:23', 
                        'speed'=&gt;'0.00', 
                     'distance'=&gt;'0.00');
  
  [1] =&gt; array('latitude'=&gt;'10.010688', 
              'longitude'=&gt;'76.361378', 
               'altitude'=&gt;'28.546305', 
              'timestamp'=&gt;'11:19:26', 
                  'speed'=&gt;'1.614', 
               'distance'=&gt;'198.525711')
   )`
  </code></pre>
  
  <p>and the required format is like this</p>
  
  <pre><code>[
    { "latitude":"10.010490",
     "longitude":"76.360779",
      "altitude":"30.833334",
     "timestamp":"11:17:23", 
         "speed":"0.00",
      "distance":"0.00"
    },    
    {
     "latitude":"10.010688",
    "longitude":"76.361378",
     "altitude":"28.546305",
    "timestamp":"11:19:26",
        "speed":"1.614",
     "distance":"198.525711" 
    }
  ]
  </code></pre>
  
  <p>Any one have solution? Thanks in advance.</p>