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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:01:04+00:00 2026-05-21T23:01:04+00:00

I’m using Cocoanetic’s pull-to-reload but with a twist: I would like the UITableView to

  • 0

I’m using Cocoanetic’s pull-to-reload but with a twist: I would like the UITableView to be able to pull up, as it were, to load more data.

I customized the classes and have managed to adjust all functionality to support this. What got me stumped, basically, is where in my code to create and add the extra view.

I first tried to add it in viewDidLoad of Cocoanetic’s class (a UITableViewController):

- (void)viewDidLoad 
{
    [super viewDidLoad];
    refreshHeaderView = [[EGORefreshTableHeaderView alloc] initWithFrame:CGRectMake(0.0f, 0.0f - self.view.bounds.size.height, 320.0f, self.view.bounds.size.height)];
    refreshFooterView = [[EGORefreshTableFooterView alloc] initWithFrame:CGRectMake(0.0f, 0.0f + self.tableView.contentSize.height, 320.0f, 20.0f)];
    [self.tableView addSubview:refreshHeaderView];
    [self.tableView addSubview:refreshFooterView];
    self.tableView.showsVerticalScrollIndicator = YES;
}

This does not work, as self.tableView.contentSize.height is zero at this point, because the table hasn’t loaded it’s data yet.

Not to worry, I thought, and tried to add it in the viewDidLoad of the UITableViewController subclass I made:

- (void)viewDidLoad
{
    [super viewDidLoad];
    // stuff
    self.model = [ListingModel listingModelWithURL:@"avalidurl" delegate:self];
    refreshFooterView = [[EGORefreshTableFooterView alloc] initWithFrame:CGRectMake(0.0f, 0.0f + self.tableView.contentSize.height, 320.0f, 20.0f)];
    [self.tableView addSubview:refreshFooterView];
}

Note I set the model first, but that also didn’t work, for the same reason. I assume the table hasn’t been layed-out yet. In frustration I gave my class a BOOL property and an addFooter method (the BOOL to make sure it’s only called once) called from tableView:cellForRowAtIndexPath: which obviously is a far cry from The Right Way™

So what would, given this scenario, be The Right Way™?

  • 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-21T23:01:04+00:00Added an answer on May 21, 2026 at 11:01 pm

    The solution was easier than I thought and 7KV7 actually gave me the hint I needed.

    - (void)viewDidLoad
    {
        [super viewDidLoad];
        // stuff
        self.model = [ListingModel listingModelWithURL:@"avalidurl" delegate:self];
        /*
         We're forcing a reload of the table here, that way the table has a
         contentSize, so adding the footerView now works correctly.
         */
        [self.tableView reloadData];
        [self addRefreshFooter];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I want to construct a data frame in an Rcpp function, but when I
I have some data like this: 1 2 3 4 5 9 2 6
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text

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.