The following code may help you ...
in the .h file of UITableView2:
declare a variable
UIActivityIndicatorView *progressInd;
create property
@property (nonatomic, retain) UIActivityIndicatorView *progressInd;
and declare a method
- (UIActivityIndicatorView *)progressInd;
in the .m file of UITableView2:
@synthesize progressInd;
define this method (adjust x, y, width, width position)
- (UIActivityIndicatorView *)progressInd {
if (progressInd == nil)
{
CGRect frame = CGRectMake(self.view.frame.size.width/2-15, self.view.frame.size.height/2-15, 30, 30);
progressInd = [[UIActivityIndicatorView alloc] initWithFrame:frame];
[progressInd startAnimating];
progressInd.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray;
[progressInd sizeToFit];
progressInd.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin |
UIViewAutoresizingFlexibleRightMargin |
UIViewAutoresizingFlexibleTopMargin |
UIViewAutoresizingFlexibleBottomMargin);
progressInd.tag = 1;
}
return progressInd;
}
at - (void)viewDidLoadwhere your parsing begins
[self.view addSubview:self.progressInd]
, .
[self.progressInd removeFromSuperview]