0

i have to add activity indicator to UITableViewController view since table view height can wary as number of rows increases its not possible to activity indicator display at center. So i think to add it as subview to window and bring it front but when i try

[[self view] window] it giving nil, i tried even

[[[self view] superView] window] then also it giving nil only.

how to overcome this...

1 Answer 1

0

I use this:

    // start our activity spinner
    if ( self.spinner == nil ) {
        self.spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
        self.spinner.center = CGPointMake(self.view.frame.size.width/2, self.view.frame.size.height/3);
        [self.view addSubview:self.spinner];    
    }
    [self.spinner startAnimating];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.