Implementing activity indicator

Posted by Prash....... on Stack Overflow See other posts from Stack Overflow or by Prash.......
Published on 2010-06-03T10:00:16Z Indexed on 2010/06/06 8:02 UTC
Read the original article Hit count: 256

Filed under:

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.

© Stack Overflow or respective owner

Related posts about iphone