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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:39:57+00:00 2026-05-29T10:39:57+00:00

I need to load 15 records initially and then when the user clicks on

  • 0

I need to load 15 records initially and then when the user clicks on the show more row of the cell, i need to load the next 20 or available records in my tableview. I am looking at this question posted in SO.

This functionality can be seen in appStore too. Where you load the next number of records.

Here the solution is;

`- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.numberOfRowsVisible;
}

-(void)moreButtonClickAction {
    if (self.numberOfRowsVisible < self.maxNumberOfRows) 
        self.numberOfRowsVisible = MIN(self.numberOfRowsVisible + 10, self.maxRows);
    [self.tableView reloadData];
}

I initialized and hard coded the value in the viewDidLoad for numberOfRowsVisible as 15.

self.numberOfRowsVisible=[NSNumber numberWithInt:15];

in numberOfRowsInSection – i am not sure if this is correct.

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{

    return MIN([self.arrayRecords count], 15);
}

in the moreButtonClickAction

-(void)moreButtonClickAction {
    if (self.numberOfRowsVisible < [self.arrayRecords count]) 
        self.numberOfRowsVisible = MIN(self.numberOfRowsVisible + 15, [self.arrayRecords count]);
    [self.tableView reloadData];
}

This is how i edited my code to suit the above suggestion left in SO. but this is not working. There seems to be some issue with MIN. I am not in MAC at the moment, so i can’t remember the exact warning/error i got. So could someone kindly help me out.

  • 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-29T10:39:57+00:00Added an answer on May 29, 2026 at 10:39 am

    1) Don’t use an NSNumber object, a plain integer will do.
    2) Why not just have an integer variable that shows the current number of rows that you want to display, and initialize with 15, and keep it in your class instance.
    3) You don’t even have to use MIN:

    return [self.arrayRecords count] < self.numberOfRowsVisible ? [self.arrayRecords count] : self.numberOfRowsVisible;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need an example of creating t-sql query to load next 10 records (depends
I need to load Dimensions from EDW Tables (which does maintain historical records) and
We have a requirement in which we need to load around 4000 records in
i have an sqlite table with 2000 records. I need to show this records
Need to load data from a single file with a 100,000+ records into multiple
Need to load data from a single file with a 100,000+ records into multiple
I have a direct load insert of 54,061,487 records. I'm looking for speed. I
I need to load a table with ~18M records in a daily basis, and
I need to load about 60 images, each on a different page, in to
I need to load an image from a web in a simple Java stand

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.