Search code examples
iphonegdata-apiuiactivityindicatorview

How to stop activity indicator view?


I am facing problem to stop the activity indicator view once it starts. I am using action sheet to send the request which fetch data from a requested url and in the mean time of fetching it takes time to load data. Meanwhile activity indicator is used to show the progress of loading. When data is fetched and loaded activity indicator view should stop. Here i am not using web view but Gdata for parsing.

My code looks like this:

 -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
   [activityIndicator startAnimating];

    //Code for parsing and loading data using gdata parser

    [activityIndicator stopAnimating];
  }

Solution

  • I come to the solution by using the instance method of action sheet where stopAnimating message should be used.

        -(void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated
        {
              [activityIndicator stopAnimating]; 
        }