Hi All , I will directly start with example to explain my problem: I have a Webservice Class that has all delegate methods used to call web service and then parse the responseXML. We have written one method in this class that initiates the webservice call and parsing of XML. The other two classes suppose A & B that want to use this webservice by calling the above method.
//Class A
#import "Webservice.h"
- viewDidLoad
{
Webservice *ws = [[Webservice alloc] init];
[ws callWebservice];
statement 1..
Statement 2..
...
}
Now what happens is [ws callWebservice]; this method gets called but returns without executing the following delegate methods written in Webservice class
-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
-(void)connectionDidFinishLoading:(NSURLConnection *)connection
after executing statement 1, statement 2 in class A , then the control goes back to above these methods.
Problem: How to call above three methods before the execution of statement 1, statement 2 as I want to use the parsed data in these two statements.
Please help.
Thnx