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

The Archive Base Latest Questions

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

i want to restore the check mark when my table view is reloaded when

  • 0

i want to restore the check mark when my table view is reloaded when i click on the table view the check mark is added and when i clicked on the 2nd cell the old checked is removed that work fine now my question is that when my tableview is reloaded the old check mark should appear on the cell.
thanks

#import "mapMenuVC.h"
#import "ViewController.h"
#import "AppDelegate.h"



@interface mapMenuVC ()

@end

@implementation mapMenuVC
@synthesize checkedIndexPath;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];







    // Do any additional setup after loading the view from its nib.
    dataArray = [[NSMutableArray alloc]initWithObjects:@"Street Map",@"Satellite View",@"Hybird", nil];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{

    return [dataArray count];
}


- (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];
    }
    if([checkedIndexPath isEqual:indexPath])
    {
        cell.accessoryType = UITableViewCellAccessoryCheckmark;
    }
    else
    {
        cell.accessoryType = UITableViewCellAccessoryNone;
    }
    cell.textLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:16.0];
    cell.textLabel.text = [dataArray objectAtIndex:[indexPath row]];
    return cell;

}




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


    if(self.checkedIndexPath)
    {
        UITableViewCell* uncheckCell = [tableView
                                        cellForRowAtIndexPath:self.checkedIndexPath];
        uncheckCell.accessoryType = UITableViewCellAccessoryNone;
    }
    if([self.checkedIndexPath isEqual:indexPath])
    {
        self.checkedIndexPath = nil;
    }
    else
    {
        UITableViewCell* cell = [tableView cellForRowAtIndexPath:indexPath];
        cell.accessoryType = UITableViewCellAccessoryCheckmark;
        self.checkedIndexPath = indexPath;
    }

    switch (indexPath.row) {
        case 0: {



            [APPDELEGATE.viewController.myMapView setMapType:MKMapTypeStandard];
            [APPDELEGATE.viewController.popoverController dismissPopoverAnimated:YES];
            break;
        }
        case 1:
        {

            [APPDELEGATE.viewController.myMapView setMapType:MKMapTypeSatellite];
            [APPDELEGATE.viewController.popoverController dismissPopoverAnimated:YES];

            break;

        }
        case 2:

        {
             [APPDELEGATE.viewController.myMapView setMapType:MKMapTypeHybrid];
            [APPDELEGATE.viewController.popoverController dismissPopoverAnimated:YES];
            break;
        }

        default:
            break;
    }

}


- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
  • 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-14T21:11:13+00:00Added an answer on June 14, 2026 at 9:11 pm

    You need to store the last checked row index so you can load that value the next time you bring up the view controller. Since you appear to only have one section you just need to save (and restore) the row index. NSUserDefaults is a good place to store this NSInteger value. You can save the row index each time a new selection is made. You can load the current value in the view controller’s viewDidLoad method.

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

Sidebar

Related Questions

Possible Duplicate: Restore a minimized window of another application I want to restore (show
I want to use the Restore last session function in firefox, on my own
I want to take backup or restore of my oracle database through .Net code.
I want to take backup of BugTracker.Net hosted on my local and restore it
I have database application, I want to allow the user to restore the deleted
I want to restore and recover my oracle database to the current state. For
I have an old commit that I did a few weeks ago. I want
From ant, we want to extract a line from an old /etc/shadow file, capturing
I just want to restore the saved preferences, but an error occurs. Login Class:
My question is that I want to restore my application's sqlite database after I

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.