Implementing activity indicator
- by Prash.......
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:
CGRect frame = CGRectMake(140, 300, 40, 37);
UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:frame];
activityIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;
[self.view addSubview:activityIndicator];
This Snippet is written in viewDidLoad() method, and I have an action called,
-(IBAction)agree:(id)sender
{
//here webservice is called
}
I have to start that activity by [activityIndicator startAnimating];
But I am unable to start that activityIndicator, please suggest a proper solution for that.