Implementing activity indicator
<p>I am implementing an activity indicator in my application. In my application on button click a webservice is called and it takes some time. To show the user that process is going on I implemented an activity indicator:</p>

<pre><code>CGRect frame = CGRectMake(140, 300, 40, 37); 
UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:frame];
activityIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray; 
[self.view  addSubview:activityIndicator];
</code></pre>

<p>This Snippet is written in <code>viewDidLoad()</code> method, and I have an action called,</p>

<pre><code>-(IBAction)agree:(id)sender
{ 
 //here webservice is called
}
</code></pre>

<p>I have to start that activity by <code>[activityIndicator startAnimating];</code></p>

<p>But I am unable to start that activityIndicator, please suggest a proper solution for that.</p>
