I created a UITableViewController in my Storyboard and then dragged a Activity Indicator View into the controller (along with creating an outlet for it), which I start and stop animating before and after some json content has loaded.
I can see the ajax spinner working fine, but it's displaying visually right beneath my navigator / title area, and when I attempt to center it, it appears centered width wise, appears at the very top near the status area...
I tried the following in an attempt to center it... Here's a quick look at my viewDidLoad:
- (void)viewDidLoad
{
[super viewDidLoad];
self.listLoader.center = CGPointMake( [UIScreen mainScreen].bounds.size.width/2,[UIScreen mainScreen].bounds.size.height/2);
UITableView *appDelegate = (UITableView *)[[UIApplication sharedApplication] delegate];
[appDelegate.window addSubview:self.listLoader];
self.operationQueue = [NSOperationQueue new];
NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(getPosts) object:nil];
[self.operationQueue addOperation:operation];
}
Please note that both my startAnimating and stopAnimating are contained within my getPosts method and are performed on the main thread. So, to avoid confusion, I can actually see the spinner, it's just all the way into the status area. In fact if I remove the lines...
self.listLoader.center = CGPointMake( [UIScreen mainScreen].bounds.size.width/2,[UIScreen mainScreen].bounds.size.height/2);
UITableView *appDelegate = (UITableView *)[[UIApplication sharedApplication] delegate];
[appDelegate.window addSubview:self.listLoader];
The spinner appears, right beneath the navigation bar...
How exactly do I center this??? I figured the method above would work, but obviously it's not working....