I used NSXML parser to parse a SOAP response XML i recieved from the web service. In my root method,
NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
I used this code to send my SOAP request, where theRequest variable has my SOAP request. so after the data is recieved ,
-(void)connectionDidFinishLoading:(NSURLConnection *)connection{
//codes to recieve webData
xmlParser = [[NSXMLParser alloc] initWithData: _webData];
[_xmlParser setDelegate: self];
[_xmlParser setShouldResolveExternalEntities: YES];
[_xmlParser parse];
}
Now, the program flows to didStartElement , didFinishDocument methods. My root method needs to return the result obtained after parsing the xml , but when I checked the program flow using breakpoints, the parsing methods doesnot end before the return statement is called in my code and hence I am not able to return the parsed values. How do I solve this?