Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7691155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:33:29+00:00 2026-05-31T20:33:29+00:00

I have a regular UITableViewController and a UITableView as its only view, and I

  • 0

I have a regular UITableViewController and a UITableView as its only view, and I want to have an UIActivittyIndicatorView in addition to the table view.

So I need a view structure like this:

view (UIView):
  tableView
  activityIndicatorView

What’s the cleanest way to do it without InterfaceBuilder? I guess I need to override the loadView: method, but I haven’t succeed doing it so far.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T20:33:30+00:00Added an answer on May 31, 2026 at 8:33 pm

    UPDATE for ARC and iOS 5.0+ (I think old version needs to be removed already as we have new, better API’s:)):

    Add to header .h file of your UIViewController subclass:

     @property (nonatomic, weak) UIActivityIndicator *activityIndicator;
    

    And override methods in .m file of your UIViewController subclass:

    - (void)loadView {
        [super loadView];
        UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
        // If you need custom color, use color property
        // activityIndicator.color = yourDesirableColor;
        [self.view addSubview:activityIndicator];
        [activityIndicator startAnimating];
        self.activityIndicator = activityIndicator;
    }
    
    - (void)viewWillLayoutSubviews {
        [super viewWillLayoutSubviews];
        CGSize viewBounds = self.view.bounds;
        self.activityIndicator.center = CGPointMake(CGRectGetMidX(viewBounds), CGRectGetMidY(viewBounds));
    } 
    

    =============================================================

    non-ARC version, iOS < 5.0:

    You should override method

    -(void)loadView {
        [super loadView];
        self.activityIndicator = [[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray] autorelease];
        [self.view addSubview:self.activityIndicator];
        self.activityIndicator.center = CGPointMake(self.view.frame.size.width / 2, self.view.frame.size.height / 2);
        [self.activityIndicator startAnimating];
    }
    

    Also, add

    @property (nonatomic, assign) UIActivityIndicatorView *activityIndicator;
    

    at the header file

    and

    @synthesize activityIndicator;
    

    to the .m file

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a regular expression like this (much simplified): ^(ab)*$ And am matching against
I have regular form like this. <form action=/domainchecker.php method=post> <input type=text name=domain size=20> <fieldset>
I have a regular expression like this: regexp = u'ba[r|z|d]' Function must return True
I have a regular expression which looks something like this: (\bee[0-9]{9}in\b)|(\bee[0-9]{9}[a-zA-Z]{2}\b) Now if the
I have a regular expression like this: :%s/pattern/ pattern/gc As you can see in
I have this regular expression in python: '<input type=hidden name=GALX value=(?P<galx>[a-zA-Z0-9_]+)>' I want an
I have regular expression like this: error 1|error 2|error 3|error 4|error 5 about 80
I have a regular expression to match filenames which look like this: name -
i have this regular expression: <%(?<begintag>[^>]+)%>(?<inner>(.+?))<%/(?<endtag>[^%]+)%> what i want to achive is, check for
I have this regular expression: ^\$?(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$ however it is failing when i have an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.