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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:10:07+00:00 2026-06-02T05:10:07+00:00

I am fairly new to iphone development, and I am trying to create my

  • 0

I am fairly new to iphone development, and I am trying to create my own “invite your friends” system using UITableViewCell. I Have checked other posts, but i do not know how to fix it. One problem i am having right now is, my UITableViewCell accessorys are repeating. for example. when I click this checkbox.

http://min.us/mCHcd3kwI
here is my project link if anyone decides to look at it

enter image description here

and if i scroll down, other checkboxs are also marked

enter image description here

I am wondering how can i fix this.

here is my code

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
switch (section) {
    case 0:
        return 4;
        break;
    case 1:
        return [aArray count];
        break;
    case 2:
        return [bArray count];
        break;
    case 3:
        return [cArray count];
        break;
    case 4:
        return [dArray count];
        break;
    case 5:
        return [eArray count];
        break;
    case 6:
        return [fArray count];
        break;
    case 7:
        return [gArray count];
        break;
    case 8:
        return [hArray count];
        break;
    case 9:
        return [iArray count];
        break;
    case 10:
        return [jArray count];
        break;
    case 11:
        return [kArray count];
        break;
    case 12:
        return [lArray count];
        break;
    case 13:
        return [mArray count];
        break;
    case 14:
        return [nArray count];
        break;
    case 15:
        return [oArray count];
        break;
    case 16:
        return [pArray count];
        break;
    case 17:
        return [qArray count];
        break;
    case 18:
        return [rArray count];
        break;
    case 19:
        return [sArray count];
        break;
    case 20:
        return [tArray count];
        break;
    case 21:
        return [uArray count];
        break;
    case 22:
        return [vArray count];
        break;
    case 23:
        return [wArray count];
        break;
    case 24:
        return [xArray count];
        break;
    case 25:
        return [yArray count];
        break;
    case 26:
        return [zArray count];
        break;
}}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell = nil;

if([tableView isEqual:self.myTableView]){
    static NSString *TableViewIdentifier = @"MyCells";
    cell = [tableView dequeueReusableCellWithIdentifier:TableViewIdentifier];
    if(cell == nil){
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:TableViewIdentifier];
    }
    NSString *group;
    NSUInteger row = [indexPath row];
    cell.selectionStyle = UITableViewCellSelectionStyleGray;


    if([selectedRowsArray containsObject:[content objectAtIndex:row]]){
        cell.imageView.image = [UIImage imageNamed:@"selected@2x.png"];
    }else {
        cell.imageView.image = [UIImage imageNamed:@"unselected@2x.png"];
    }
    cell.imageView.userInteractionEnabled = YES;


    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(handleChecking:)];
     [cell.imageView addGestureRecognizer:tap];


    switch (indexPath.section) {
        case 0:
            group = [suggestedPeople objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 1:
            group = [aArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 2:
            group = [bArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 3:
            group = [cArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 4:
            group = [dArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 5:
            group = [eArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 6:
            group = [fArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 7:
            group = [gArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 8:
            group = [hArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 9:
            group = [iArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 10:
            group = [jArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 11:
            group = [kArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 12:
            group = [lArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 13:
            group = [mArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 14:
            group = [nArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 15:
            group = [oArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 16:
            group = [pArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 17:
            group = [qArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 18:
            group = [rArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 19:
            group = [sArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 20:
            group = [tArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 21:
            group = [uArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 22:
            group = [vArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 23:
            group = [wArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 24:
            group = [xArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
        case 25:
            group = [yArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;

        case 26:
            group = [zArray objectAtIndex:row];
            cell.textLabel.text = group;
            break;
    }

}
return cell;

}

  • 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-02T05:10:11+00:00Added an answer on June 2, 2026 at 5:10 am

    It’s because you are only storing the row to determine whether a cell is checked or not. Since every section has a cell at index 0/1, this does not work as you want it to.

    if([selectedRowsArray containsObject:[content objectAtIndex:row]]){
        cell.imageView.image = [UIImage imageNamed:@"selected@2x.png"];
    }else {
        cell.imageView.image = [UIImage imageNamed:@"unselected@2x.png"];
    }
    

    Replace it with this: (assuming you you have an NSMutableSet as a property self.selectedIndexPaths)

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        ...
        if ([self.selectedIndexPaths containsObject:indexPath])
        {
            cell.imageView.image = [UIImage imageNamed:@"selected@2x.png"];
        }
        else
        {
            cell.imageView.image = [UIImage imageNamed:@"unselected@2x.png"];
        }
        ...
    }
    
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        if ([self.selectedIndexPaths containsObject:indexPath])
        {
            [self.selectedIndexPaths addObject:indexPath];
        }
        else
        {
            [self.selectedIndexPaths removeObject:indexPath];
        }
    
        [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As someone who is fairly new to iPhone development, I've been trying to find
Fairly new to iPhone/Cocoa development, so I'm having difficulty adjusting. I want to create
I am fairly new to iphone development and programming in general and am wondering
I am fairly new to iPhone development. Right now, I am working on an
I am fairly new to a objective-c or in whole mac/iphone development. My question
I'm fairly new to iPhone programming and am trying to implement a double-component PickerView.
Being fairly new to iPhone / Objective-C development, I wanted to ask this question
im fairly new to android development, but i'm having some trouble trying to make
I'm fairly new to xcode and iPhone development and I'm wondering if it's possible
I'm fairly new to iPhone development and I've hit a roadblock in my understanding

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.