All
I am trying to run UIActivityIndicator
for a 5 seconds on viewdidappear
method .But how do i give a time limit for activity indicator(5 seconds) ?
This is the code for UIActivityIndicator
UIActivityIndicatorView *activityView=[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
activityView.center=self.view.center;
[activityView startAnimating];
[self.view addSubview:activityView];
With one line and no additional dependencies & conditions:
[activityView performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:5.0];