Calling web service from another class
<p>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 &amp; B that want to use this webservice by calling the above method.</p>

<pre><code>//Class A
#import "Webservice.h"
- viewDidLoad
{
Webservice *ws = [[Webservice alloc] init];
[ws callWebservice];
statement 1..
Statement 2..
...   
}
</code></pre>

<p>Now what happens is [ws callWebservice]; this method gets called but returns without executing the following delegate methods written in Webservice class </p>

<pre><code>-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 
-(void)connectionDidFinishLoading:(NSURLConnection *)connection
</code></pre>

<p>after executing statement 1, statement 2 in class A , then the control goes back to above these methods.
<strong>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.</strong><br />
Please help.
Thnx</p>
