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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:27:13+00:00 2026-06-10T06:27:13+00:00

I am parsing XML that gets the first 25 items in my MySQL database

  • 0

I am parsing XML that gets the first 25 items in my MySQL database using PHP – LIMIT and GET. When I click on the “Load More” cell that I append to the bottom of my tableview, it successfully gets the next 25 items, but only loads the first 40 and leaves off the last 10. Each time I click on the “Load more” cell it add 25 to my range (ie 0-25,25-50), but it seems that my range caps at 65 and the display caps at 40.

Here is my load more function thats not working:

-(void) getNewRange{
    int currentRange = [allItems count];
    int newRange = currentRange + 25;

    if(newRange > [xmlParser total]){
        NSLog(@"evaluating as greater than the total, which is 837");
        newRange = [xmlParser total];
    }

    NSString *range = [[NSString alloc] initWithFormat:@"?range=%d&range2=%d",currentRange,newRange];
    NSString *newUrl =[[NSString alloc] initWithFormat:@"http://localhost/fetchAllTitles.php%@",range];

    XMLParser *tempParser = [[XMLParser alloc] loadXMLByURL:newUrl];
    [allItems addObjectsFromArray:[tempParser people]];
    NSMutableArray *newCells = [[NSMutableArray alloc] initWithCapacity:25];

    for(int i=currentRange;i<newRange;i++){
        NSLog(@"%d",i);
         NSIndexPath *indexpath=[NSIndexPath indexPathForRow:i inSection:0];
        [newCells addObject:indexpath];
    }

    NSLog(@"%@",newUrl);

    [self.tableView insertRowsAtIndexPaths:newCells withRowAnimation:UITableViewRowAnimationAutomatic];
}

I’m getting closer, but I get this new error:

*** Assertion failure in -[_UITableViewUpdateSupport _computeRowUpdates], /SourceCache/UIKit_Sim/UIKit-1912.3/UITableViewSupport.m:386
  • 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-10T06:27:14+00:00Added an answer on June 10, 2026 at 6:27 am

    UITableView isn’t a class to contain your data, and you shouldn’t try to directly micromanage what cells it displays. As another poster stated, read up on how to use it. What you should do is:

    -(void)loadNewData
    {
        NSIndexPath *index;
        XMLParser *tempParser = [[XMLParser alloc] loadXMLByURL:newUrl];
        NSArray *people=[tempParser people];
        for(id *person in people)
        {
            [self.dataArray addObject:person];
            indexPath=[NSIndexPath indexPathForRow:[self.dataArray indexForObject:person] inSection:0];
            [tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath withRowAnimation:UITableViewRowAnimationAutomatic];
        }
    }
    
    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
    { 
        return 1;
    }
    
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    {
        return [AnArray count];//use whatever array stores your data
    }
    
    
    //If you've subclassed the cell, adjust appropriately.
    -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:@"cell"];
        if (!cell) {
            cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
        }
        //Customize the cell
        return cell;
    }
    

    The table view will take care of all the logic involved in displaying the cells, if you let it. This way, you only have a limited number of cells taking up memory at any given time, and you don’t have to handle that — the table view automagically handles reusing the cells, and knowing how many are needed as a buffer before / after.

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

Sidebar

Related Questions

I'm writing a program that's parsing an XML file to java objects using smooks.
I am parsing XML that gets returned from a web service. If it is
I am currently connecting to a database that then gets a bunch of xml
This is a xml structure that I want to parse using libxml parsing. How
I am parsing some XML that will have a link such as the following
there is a xml document that i'm parsing to array.. how can i access
I'm looking for an XML parser that instead of parsing from an InputStream or
I am parsing an xml file with jquery and ajax. I noticed that it
I have an NSArray of (Product) objects that are created by parsing an XML
I am parsing and html/xml file. I am bit confused with the fact that

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.