0
votes

I'd like to add a progress bar to this view and display a blank table while it's loading in data. Any idea how I do this?

Currently I've tried adding this view as a subview in viewDidLoad and viewWillAppear but both show a black screen until the table is built.

Thanks!

2

2 Answers

1
votes

You can use ATMHud for the progress bar and do a row insert on your table once you are done preloading data. Add this anywhere in your view controller:

ATMHud *myHud = [[[ATMHud alloc] initWithDelegate:self] autorelease];
[myHud setCaption:@"loading stuff"];
[self addSubview:myHud.view];
[myHud show];
// ... load data ....
[myHud hide];
0
votes

In the view controller that controls your tableview int he view did load method add a the cover view with loading info as a subview to the tableview. When the data is ready or your tableview finishes loading add a method to remove this loading view.

- (void)viewDidLoad
{
   [tableview addSubview:mycoverView]; 
}  

- (void)removeCoverView
{
   [mycoverView removeFromSuperView];
}

!Make sure that you set the bounds to resize the view so that its size will cover the table view. If you if you don't resize it you may never see it. You may want to change the background color to something obvious (red) so that you see where the view actually is when its added to the tableview for troubleshooting.