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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:31:46+00:00 2026-05-28T17:31:46+00:00

I am running into a crazy problem when dealing with the UITableView , do

  • 0

I am running into a crazy problem when dealing with the UITableView, do you have any good sample projects (github) or tutorials that show how to do a multiple selections(checking) on a sectioned UITableView, i mean a long UITableView where the user can scroll up and down it and select/deselect the cells in different sections.
The problem i ran is concerning checking cells in different sections, and scrolling up and down the table view. The app crashes, and in a better case, i get random cells checked when i scroll down and up the screen (the table view). So i decided to make a simple project in which i try all that before integrating it into my app.

One of the suit of actions that give rise to the crash is: check cell1 in section1 and check cell2 in section2, then uncheck cell1 in section1.
The sample is here, please test it, it’s too lightweight, tracking the crash with breakpoint, i found that this method is causing the issue:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    NSDictionary *dict = [self.tableData objectAtIndex:[self tableIndexFromIndexPath:indexPath]];//this statement is the issue, i think the app is conflicting between sections when check/uncheck cells
    BOOL newState = ![[dict objectForKey:kCellStateKey] boolValue];
    NSDictionary *newDict = [NSDictionary dictionaryWithObjectsAndKeys:[dict objectForKey:kCellTextKey], kCellTextKey, [NSNumber numberWithBool:newState], kCellStateKey, nil];
    [self.tableData replaceObjectAtIndex:indexPath.row withObject:newDict];

    [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
}

I really need your expertise to improve my code. Thanx in advance.

  • 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-28T17:31:47+00:00Added an answer on May 28, 2026 at 5:31 pm

    The table does not like replacing the DICTs for some reason even when allocated correctly, This will work.

    1) Change all Dicts to MutableDicts

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
    {
        NSMutableDictionary *dict = [self.tableData objectAtIndex : [self tableIndexFromIndexPath : indexPath]];
    
        BOOL newState = ![[dict objectForKey:kCellStateKey] boolValue];
    
        [dict setValue :[NSNumber numberWithBool:newState] forKey : kCellStateKey];
    
        NSArray *test = [[NSArray alloc]initWithArray : [NSArray arrayWithObject:indexPath] ];
    
        [tableView reloadRowsAtIndexPaths : test withRowAnimation:UITableViewRowAnimationNone];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running into a little problem that's driving me crazy, and I'd welcome any
Running into a problem where on certain servers we get an error that the
Running into a problem. I have a table defined to hold the values of
Running into the strangest problem on iPhone using jQuery with my WebViewController. I have
I'm running into a bit of a problem with my WCF service that is
Running into a major brick wall here. I have a database of data that
I've run into a problem that's driving me crazy. In my application (ASP.NET MVC2
Been running into this problem lately... When debugging an app in VS.Net 2005, breakpoints
I'm running into an issue where I have a FileUpload control in an UpdatePanel.
I am currently running into a problem where an element is coming back from

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.