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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:02:04+00:00 2026-06-04T00:02:04+00:00

I have TableView and in this TableView I’m printing articles. Now user must click

  • 0

I have TableView and in this TableView I’m printing articles. Now user must click in navigation bar item to update(download more articles from web over json). I want and I think that is better that when user scroll to bottom that automaticaly shows loading cell and start to loading or getting more articles from web.

My questions are next:

  1. How to put that extra cell in which would appear loading indicator
  2. and loading text How to automatically get more articles?

This functionality is in iphone app “App Store” but with click load more items.

Maybe is better to put button load more articles?

All examples and suggestions are welcome.

Thank’s for help

  • 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-06-04T00:02:05+00:00Added an answer on June 4, 2026 at 12:02 am

    This one is easy it’s add an UITablecell at the end to load more items.

    //
    //  TableViewController.m
    //  PartialTable
    //
    //  Created by Abizer Nasir on 07/07/2011.
    //
    
    #import "TableViewController.h"
    
    #define kNumberOfItemsToAdd 8
    
    @implementation TableViewController
    
    @synthesize items;
    
    // Mark: -
    // Mark: Set up and tear down
    
    - (id)init  {
        // New designated initialiser
        if (!(self = [super initWithStyle:UITableViewStyleGrouped])) {
            return nil; // Bail!
        }
        numberOfItemsToDisplay = kNumberOfItemsToAdd; // Show 10 items at startup
        return self;
    }
    
    
    - (id)initWithStyle:(UITableViewStyle)style {
        // Call out to the new designated initialiser
        return [self init];
    }
    
    - (void)dealloc {
        [items release];
        [super dealloc];
    }
    
    #pragma mark - View lifecycle
    
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        // Return YES for supported orientations
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    }
    
    #pragma mark - Table view data source
    
    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
        if (numberOfItemsToDisplay == [items count]) {
            return 1;
        }
        return 2;
    }
    
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
        if (section == 0) {
            return numberOfItemsToDisplay;
        } else {
            return 1;
        }
    }
    
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
        static NSString *CellIdentifier = @"ItemCell";
    
        // If the indexPath is less than the numberOfItemsToDisplay, configure and return a normal cell,
        // otherwise, replace it with a button cell.
    
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (!cell) {
            cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
        }
    
        if (indexPath.section == 0) {            
            cell.textLabel.text = [items objectAtIndex:indexPath.row];
            cell.textLabel.textAlignment = UITextAlignmentLeft;        
            cell.textLabel.textColor = [UIColor blackColor];
            cell.textLabel.font = [UIFont boldSystemFontOfSize:17.f];
    
        } else {
            cell.textLabel.text = [NSString stringWithFormat:NSLocalizedString(@"Next %d items", @"The text to display to load more content"), kNumberOfItemsToAdd];
            cell.textLabel.textAlignment = UITextAlignmentCenter;
            cell.textLabel.textColor = [UIColor colorWithRed:0.196f green:0.3098f blue:0.52f alpha:1.f];
            cell.textLabel.font = [UIFont boldSystemFontOfSize:14.f];
        }
    
        return cell;
    }
    
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
        if (indexPath.section == 1) {
            NSUInteger i, totalNumberOfItems = [items count];        
            NSUInteger newNumberOfItemsToDisplay = MIN(totalNumberOfItems, numberOfItemsToDisplay + kNumberOfItemsToAdd);
            NSMutableArray *indexPaths = [[NSMutableArray alloc] init];        
    
            for (i=numberOfItemsToDisplay; i<newNumberOfItemsToDisplay; i++) {
                [indexPaths addObject:[NSIndexPath indexPathForRow:i inSection:0]];
            }        
    
            numberOfItemsToDisplay = newNumberOfItemsToDisplay;                
    
            [tableView beginUpdates];
            [tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationTop];
            [indexPaths release];                
            if (numberOfItemsToDisplay == totalNumberOfItems) {
                [tableView deleteSections:[NSIndexSet indexSetWithIndex:1] withRowAnimation:UITableViewRowAnimationTop];
            }        
            [tableView endUpdates];
            // Scroll the cell to the top of the table
            if (newNumberOfItemsToDisplay < totalNumberOfItems) {
                dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 200000000), dispatch_get_main_queue(), ^(void){
                    [tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:YES];
                });
                [tableView deselectRowAtIndexPath:indexPath animated:YES];
            } else {
                dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 200000000), dispatch_get_main_queue(), ^(void){
                    [tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:totalNumberOfItems-1 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES];
                });
            }
    
        }    
    }
    
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this that works: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath Item *objItem =
I have this tableview in my app which has a particular item name such
I have a tableview with a search bar. All is working fine but now
I have a tableview controller with many statics cells. When i click on one
here I have a tableView in my viewController, and it's like this: //.h ...
I have a code snippet that looks like this: [tableView beginUpdates]; [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
I have a tableview controller under a navigation controller. Some of my table cells
I have a TableView who display the name of some Categories by executing this
I have a TableView, when I click on a cell it pushes my class
I have a tableview (linked to a database) and a search bar. When I

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.