NSURLConnection with synchrounous call not returning values sometime?
<p>I am calling one URL which returns JSON string as response. I have used NSURLConnection with synchronous call but my problem is i can able to get the result the sometimes and sometimes i am getting nil value as response. Can anyone tell me where i did mistake in the below code.</p>

<p>Code which i have used to call url is below,</p>

<pre><code>NSURL *urlString=[NSURL URLWithString:request];
NSURLRequest *urlReq=[[NSURLRequest alloc] initWithURL:urlString];
NSURLResponse *response=nil;
NSError *errorVal=nil;

NSData *responseData=[NSURLConnection sendSynchronousRequest:urlReq returningResponse:&amp;response error:&amp;errorVal];
</code></pre>

<p>Please anyone help me where i did mistake.</p>

<p>Thanks in advance.</p>
