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 7186057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:33:08+00:00 2026-05-28T18:33:08+00:00

I’ve a UITableView where the data source is Core Data using a NSFetchRequest .

  • 0

I’ve a UITableView where the data source is Core Data using a NSFetchRequest. The Core Data contains news items downloaded from the database on my website. The Core Data is by default containing the 50 newest items and older items is lazy downloaded, when the bottom of the UITableView is reached.

I’m currently dealing with this using the tableView:numberOfRowsInSection method, where I’m returning +1 for the last section, which is my “Loading items” cell. In the tableView:cellForRowAtIndexPath method I’m creating the “Loading items” cell, when the IndexPath is the last row in the last section.

By problem is, that when the new data is downloaded the cell that before was the “Loading items” cell, is now a regular news item cell. But then cell is first reloaded, when I scroll away from the cell and comes back.

I could store the indexPath for the “loading items” cell and reload that cell, when the lazy load is finished. But I would like to know, if any better solutions to this problem exists?

EDIT1:

Here is my procedure for creating the “loading items” UITableViewCell.

cell.textLabel.text = [NSString stringWithFormat:@"%@\u2026", NSLocalizedString(@"LOADING_MORE", nil)];

UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];

UIImage *spacer = [UIImage imageNamed:@"Spacer"];

UIGraphicsBeginImageContext(spinner.frame.size);
[spacer drawInRect:CGRectMake(0,0,spinner.frame.size.width,spinner.frame.size.height)];
UIImage* resizedSpacer = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

cell.imageView.image = resizedSpacer;
[cell.imageView addSubview:spinner];
[spinner startAnimating];

EDIT2:

I’m trying to “design” the footerView using the below code. Currently the activity indicator is places in the top left position and the label is not visible.

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    NSInteger sectionsAmount = [tableView numberOfSections];
    if (section == sectionsAmount - 1) {
        return 20;
    }
    return 0;
}

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
    NSInteger sectionsAmount = [tableView numberOfSections];
    if (section == sectionsAmount - 1) {
        if (_tableFooterView==nil) {
            UIView *view = [[UIView alloc] init];

            UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];

            UIImage *spacer = [UIImage imageNamed:@"Spacer"];

            UIGraphicsBeginImageContext(spinner.frame.size);
            [spacer drawInRect:CGRectMake(0,0,spinner.frame.size.width,spinner.frame.size.height)];
            UIImage* resizedSpacer = UIGraphicsGetImageFromCurrentImageContext();
            UIGraphicsEndImageContext();

            UIImageView *imageView = [[UIImageView alloc] init];

            imageView.image = resizedSpacer;
            [imageView addSubview:spinner];
            [spinner startAnimating];

            [view addSubview:imageView];

            UILabel *label = [[UILabel alloc] init];
            label.text = [NSString stringWithFormat:@"%@\u2026", NSLocalizedString(@"LOADING_MORE", nil)];
            [view addSubview:label];

            _tableFooterView = view;
        }
        return self.tableFooterView;
    }
    return nil;
}

How can I change the UIView to look like the the below image:
Loading more..

EDIT3:

Here is my setupTableFooterView where I’m assigning a view to the tableFooterView. The method is called from the viewDidLoad.

- (void) setupTableFooterView {
    UIView *view = [[UIView alloc] init];

    UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];

    UIImage *spacer = [UIImage imageNamed:@"Spacer"];

    UIGraphicsBeginImageContext(spinner.frame.size);
    [spacer drawInRect:CGRectMake(0,0,spinner.frame.size.width,spinner.frame.size.height)];
    UIImage* resizedSpacer = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();

    UIImageView *imageView = [[UIImageView alloc] init];

    imageView.image = resizedSpacer;
    [imageView addSubview:spinner];
    [spinner startAnimating];

    imageView.frame = CGRectMake(10, 11, 20, 20);
    [view addSubview:imageView];

    UILabel *label = [[UILabel alloc] init];
    label.text = [NSString stringWithFormat:@"%@\u2026", NSLocalizedString(@"LOADING_MORE", nil)];
    [label setFont:[UIFont italicSystemFontOfSize:13]];
    [label setFrame:CGRectMake(40, 0, 270, 43)];
    [view addSubview:label];

    self.tableView.tableFooterView = view;
}
  • 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-28T18:33:09+00:00Added an answer on May 28, 2026 at 6:33 pm

    Use the UITableView tableFooterView instead for that message. That way you do not have to fiddle around with the section/row-structures.

    From the UITableView reference:

    tableFooterView
    

    Returns an accessory view that is displayed below the table.

    @property(nonatomic, retain) UIView *tableFooterView
    

    Discussion

    The default value is nil. The table footer view is different from a
    section footer.

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

Sidebar

Related Questions

We are using XSLT to translate a RIXML file to XML. Our RIXML contains
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

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.