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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:29:50+00:00 2026-05-22T14:29:50+00:00

Trying to implement settings in my app. What I need is a check list.

  • 0

Trying to implement settings in my app. What I need is a check list. I used

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath  *)indexPath {
     static NSString *CheckMarkCellIdentifier = @"CheckMarkCellIdentifier";
     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: CheckMarkCellIdentifier];
     if (cell == nil) { 
         cell = [[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CheckMarkCellIdentifier] autorelease];
     } 
     NSUInteger row = [indexPath row];
     NSUInteger oldRow = [lastIndexPath row]; 
     cell.textLabel.text = [list objectAtIndex:row]; 
     cell.accessoryType = (row == oldRow && lastIndexPath != nil) ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone; 
     return cell;
 }

and

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 
     int newRow = [indexPath row];
     int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1;
     if (newRow != oldRow) { 
         UITableViewCell *newCell = [tableView cellForRowAtIndexPath:indexPath];    
         newCell.accessoryType = UITableViewCellAccessoryCheckmark;
         UITableViewCell *oldCell = [tableView cellForRowAtIndexPath: lastIndexPath];
         oldCell.accessoryType = UITableViewCellAccessoryNone; 
         lastIndexPath = indexPath;
     } 
     [tableView deselectRowAtIndexPath:indexPath animated:YES];
     [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInt:lastIndexPath.row] forKey:@"lastIndexPath"];
     [[NSUserDefaults standardUserDefaults] synchronize];
 }

What I need is to save checkMark position to UserDefaults…And restore it when I will open Check List again…How to do that ? Thanks…

  • 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-22T14:29:50+00:00Added an answer on May 22, 2026 at 2:29 pm

    What you can do is save the value of the cell text to your NSUserDefaults then compare it in cellForRowAtIndexPath:

    if([cell.textLabel.text isEqualToString:[[NSUserDefault standardUserDefaults] objectForKey:@"someValue"]]){
        cell.accessoryType = UITableViewCellAccessoryCheckmark;
    }else{
        cell.accessoryType = UITableViewCellAccessoryNone;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to implement a UITableView of names similar to the built-in Contacts iPhone app
i am trying to implement OTA settings update for my app. didn't find any
Hi I'm trying to implement a settings page on my Android App. I defined
I'm trying to implement a seek bar preference into my live wallpaper settings. The
I am trying to implement Facebook into my Android app. Everytime though, the facebook
I have a Rails 3 app that I am trying to implement devise and
I have a Rails 3 app that I am trying to implement devise and
I'm trying to implement ShareKit in my app; in the SHKConfig.h file, in the
I have a flipside view showing the settings in my app. I'm trying to
I'm trying to implement a simple App that let me choose extras in a

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.