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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:44:36+00:00 2026-05-26T07:44:36+00:00

Ok as the title suggests, I am trying to insert more rows in a

  • 0

Ok as the title suggests, I am trying to insert more rows in a uitableview when the user scrolls to the bottom of the list. The whole reason is to lazily load the data for performance reasons with a large data set.

The odd thing is that if I scroll slowly then it works fine, but if I scroll quickly then it crashes on [tableView endUpdates];

The datasource is a nsmutablearray which loads data from coredata, using a common fetchRequest. I cannot use a fetchedResultsController in my current circumstances.

The datasource count is correct before and after the insert is called. The row count (and data source count) are correct.

If I scroll slowly and later at some point scroll quickly, it crashes, with usually the same error with the index being beyond the bounds, however the index and bounds in the error message are incorrect with the original counts when the tableview was first bound (and before any insertions occured). Ie row count of 4 and datasource count of 4 & etc.

This is the error:

Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 3 beyond bounds [0 .. 2]'

I also tried inserting rows during the cellForRowAtIndexPath method but with the same result.

Any ideas?

  • 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-26T07:44:37+00:00Added an answer on May 26, 2026 at 7:44 am

    That is not the right way to solve large data set scrolling problems.

    1. The UITableView is designed to only keep a small number of cells in memory at any one time.
    2. Trying to fetch data while scrolling will perform horribly as disk access is significantly slower than UI updates.

    Instead you should consider limiting your batch size when fetching your data from Core Data. Secondarily you should also run instruments against your app and confirm where the hotspots are. It is highly unlikely that the scrolling or population of cells is the slow point.

    BTW, an NSMutableArray is rarely useful when dealing with the results from Core Data. Unless you have a specific reason to have a NSMutableArray you should probably change it to a NSArray.

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

Sidebar

Related Questions

As the Title suggests, i am trying to find how to insert image in
As the title suggests, I am trying to load an image using DevIL, before
As the title suggests, I'm trying to get the caption of the associated label
As the title suggests I am trying to add an event listener to a
As the title suggests I'm simply trying to get a named window to come
I am trying to do as the title suggests, however I am getting confused.
As the title suggests I've been trying to trigger a onmousedown even and then
As the title suggests, I am trying to nest - or create an array
As the title suggests, I'm trying to find a post through its post_content .
Just like the title suggests, I'm trying to parameterize the XPath for a modify()

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.