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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:00:55+00:00 2026-06-12T16:00:55+00:00

I have a iOS app that, in a nutshell, uses a UITableView and a

  • 0

I have a iOS app that, in a nutshell, uses a UITableView and a few buttons to change out the contents of the table. I was getting an error earlier in the development regarding the number of rows being inconsistent before and after a reloadData call but then found out what I was doing incorrectly.

Now however I’m getting a report from a tester that his iPad 1 is crashing, and looking at the stack trace I can see that the same error, as described above, is happeing. But all other iPad 2 testers seem to work correctly and they are all using the same data sets to populate the tables.

Here is how I am populating the tableview:

[tableviewController.data removeAllObjects] //Delete the old data. Tableviewcontroller is the delegate for self.tableview
[self.tableview performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
[tableviewController setData:[newDataSetArray mutableCopy]]; //Copy over a new dataset array
[self.tableview performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];

If anybody has any idea why this might be happening and could point it out I would really appreciate it.

EDIT:
A few more details. After hearing about this problem we had the tester delete the local copy of the app, and fetch the newest version.
Further more, he and the other testers are all running iOS 5.1.1 so as far as I can see the only inconsistency is the hardware version. But this doesn’t make sense :/

  • 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-12T16:00:56+00:00Added an answer on June 12, 2026 at 4:00 pm

    My thought would be why not just do this:

    [tableviewController setData:[newDataSetArray mutableCopy]]; //Copy over a new dataset array
    [self.tableview performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
    

    You don’t really need to clear the old one and reload, then set the new one and reload.

    However, I would be careful with threading. It looks like this bit of code is being run from not-the-main-thread which means the datasource for the table might race with the setting of the data. An alternative would be to whack the whole lot on the main thread like so:

    dispatch_async(dispatch_get_main_queue(), ^{
        [tableviewController setData:[newDataSetArray mutableCopy]]; //Copy over a new dataset array
        [self.tableview reloadData];
    });
    

    But also what I’m quite confused by is what is tableviewController if the table view you’re reloading is self.tableview? Is self not the same as tableviewController?

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

Sidebar

Related Questions

I have an iOS app that uses a number of enums for valid values,
I have an iOS app with a UITableView that has flexible width, which allow
I have an iOS app that uses a SQLite DB to store its data
I tried this on a few devices, I have an iOS app that crashes
I have an iOS app that uses sqlite3 databases extensively. I need to add
I have developed an iOS app that uses CoreData/SQLite. It works, but now I
I have an iOS app that has a UITableView with custom TableViewCells that contain
I have an ios app that uses the master detail template, the master view
I have an old iOS app that I never distributed and am now trying
I have a Rails app that has 2 clients -- an iOS app reads/writes

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.