views:

169

answers:

0

i am following code from apple examples. this code is used in a method called login and i call this method from another class ABC. My problem is this when i call the Login method it will execute the code

NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if (theConnection) { 
    receivedData=[[NSMutableData data] retain];
}

and then goes back to caller class ABC where the control of caller class goes out and then it will come back to the delegates methods of Nsurlconnection.

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

and then to xml parser and actually fetcht the returned data. so i am never able to get the data from my caller class. Can anyone tell me solution for this problem.I am totally new in oobjective c it could be nice if someone can show code examples as well Thanks in advance.