В .h
классе,
UIActivityIndicatorView *activity;
И использовал этот код в своем классе реализации,
- (void)viewDidLoad {
[super viewDidLoad];
//initialise activityIndicator and add it to view
activity = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
activity.frame = CGRectMake(150,200, 20, 20);
[self.view addSubview:activity];
[activity startAnimating];
//call timer to fire after your required time
[NSTimer scheduledTimerWithTimeInterval:1.5 target:self selector:@selector(timerMethod:) userInfo:nil repeats:NO];
}
Timer Action,
-(void) timerMethod : (NSTimer *) theTimer {
// after 1.5 seconds, the activity indicator will be hidden.
[activity stopAnimating];
}