NSURLConnection delegate method: didReceiveData not called ...Why ?? (iPhone SDK)
<p>Sample Code:</p>

<pre><code>-(void)ConnectWithRequest:(NSMutableURLRequest*)req{

if(![req isEqual:theRequest]){
    [req retain];
    [theRequest release];
    theRequest = req;
}

XMLConnection = [[XMLWebServiceConnection alloc]init];  
Connection=[[NSURLConnection alloc]initWithRequest:theRequest delegate:XMLConnection];
}
</code></pre>

<p>In XMLConnection class i have implemented NSURLConnection delegate methods:</p>

<pre><code>-(id)init{

    if(self=[super init]){
        receivedData = [[NSMutableData alloc]init]; //member of a class
    }
    return self;
}


- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error{
    [receivedData release];
}

- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response{
    [receivedData setLength:0]; 
}

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data{
    [receivedData appendData:data]; 
}

- (void)connectionDidFinishLoading:(NSURLConnection *)connection{

    NSString *theXML = [[NSString alloc] initWithBytes: [receivedData mutableBytes] length:[receivedData length] encoding:NSUTF8StringEncoding];

    NSLog(@"\nResponse printed :\n\n\n %@\n",theXML);

    [theXML release];

}
</code></pre>

<p>when i run this code,</p>

<p>method:</p>

<pre><code>connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
</code></pre>

<p>didn't get called, any reason why this happens ? How to solve this problem ??</p>

<hr>

<p>Thanks</p>
