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

  • Home
  • SEARCH
  • 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 8835261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:13:11+00:00 2026-06-14T09:13:11+00:00

I am using two NSMutable Arrays for storing multiple checkmarks.. repeatDaysToStore and data1 .

  • 0

I am using two NSMutable Arrays for storing multiple checkmarks..repeatDaysToStore and data1.
This is the code in viewDidLoad method…

for (int i=1; i<=[repeatDaysToStore count]; i++) 


{

    BOOL isTheObjectThere = [repeatArray containsObject:[repeatDaysToStore objectAtIndex:(i-1)]];

    if (isTheObjectThere) 
    {

        NSString *into=[repeatArray objectAtIndex:[repeatArray indexOfObject:[repeatDaysToStore objectAtIndex:(i-1)]]];


              [data1 addObject:into];

        NSLog(@"check did load");

    }



}

and after this I am using data1 array for checking the cells…

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:                  (NSIndexPath *)indexPath
 {
    static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
 if (cell == nil) {

    cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault   reuseIdentifier:CellIdentifier];
 }
 cell.textLabel.text=[repeatArray objectAtIndex:indexPath.row];
tableView.allowsMultipleSelection=YES;
 for (int j=1; j<=[data1 count]; j++) {
     NSLog(@"%d",[[data1 objectAtIndex:(j-1)]intValue]);
       NSLog(@"%d",indexPath.row);
   if([data1 indexOfObject:[data1 objectAtIndex:(j-1)]]==indexPath.row)
     {
  cell.accessoryType = UITableViewCellAccessoryCheckmark;
 } 
 else
  {
       cell.accessoryType = UITableViewCellAccessoryNone;
  }

  }

and for handling row selections I am using this code in didSelectRowAtIndexPath
{
NSString *myobj=[repeatArray objectAtIndex:indexPath.row];

    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];    
      if (cell.accessoryType == UITableViewCellAccessoryCheckmark) {
        cell.accessoryType = UITableViewCellAccessoryNone;
        [repeatDaysToStore removeObject:myobj];
        [data1 removeObject:myobj];


    } else {
        cell.accessoryType = UITableViewCellAccessoryCheckmark;
        [repeatDaysToStore addObject:myobj];
        [data1 addObject:myobj];

    }
[tableView reloadData];
 }

but its not working.Someone please tell me what is wrong?

  • 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-14T09:13:12+00:00Added an answer on June 14, 2026 at 9:13 am

    I think the issue is with cellForRowAtIndexPath: method’s following code:

    for (int j=1; j<=[data1 count]; j++)
    {
         NSLog(@"%d",[[data1 objectAtIndex:(j-1)]intValue]);
         NSLog(@"%d",indexPath.row);
       if([data1 indexOfObject:[data1 objectAtIndex:(j-1)]]==indexPath.row)
       {
         cell.accessoryType = UITableViewCellAccessoryCheckmark;
       } 
       else
       {
           cell.accessoryType = UITableViewCellAccessoryNone;
       }
    }
    

    Remove the code and write the condition like:

    if([data1 containsObject:[repeatArray objectAtIndex:indexPath.row])
    {
       cell.accessoryType = UITableViewCellAccessoryCheckmark;
    } 
    else
    {
       cell.accessoryType = UITableViewCellAccessoryNone;
    }
    

    Also remove the [tableView reloadData]; from didSelectRowAtIndexPath:

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

Sidebar

Related Questions

I am using insertObject for NSMutableArray for storing values into two dimensional array like
I created a two dimensional array using one nsmutablearray, and there is a method:
I'm using Parse as my backend service, but for this example I created two
Using the Graph Facebook API with this code [facebook requestWithGraphPath:@me/friends andDelegate:self]; Now I have
I'm using the following method to determine the number of days between two NSDate's
I Using Two Table User And Location In User Table I having LocationId And
I am using two jQuery scripts. One is for controlling the drop down navigation
I am using two different scripts on one page and when I call them
I am using two button s Date and Time .They are working well .
I'm using two different TapGestureRecognizer to handle both single and double tap on screen.

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.