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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:10:58+00:00 2026-05-13T18:10:58+00:00

I have an app that has a tab bar, each tab contains a separate

  • 0

I have an app that has a tab bar, each tab contains a separate table. The first table uses core data to persist its entries and checkmarks. The second table on the second tab uses an NSMutableArray to populate it (I would use core data but I would have to pre populate it and this table does not allow that) I would like to persist check marks the same way I do in the first table with core data but something is wrong. The code looks like this:

 -(void)viewDidLoad {
    [super viewDidLoad];
airport = [[NSMutableArray alloc] init];
[airport addObject:@"Passport"];
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}


// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [airport count];
}


// Customize the appearance of table view 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] autorelease];
}

// Set up the cell...
NSString *cellValue = [airport objectAtIndex:indexPath.row];
cell.textLabel.text = cellValue;
//[cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];


NSManagedObject *item = [[self fetchedResultsController] objectAtIndexPath:indexPath];
cell.textLabel.text = [item valueForKey:@"name"]; //CHANGED TO DETAIL


if ([[item valueForKey:@"check"] boolValue]) {
    cell.accessoryType = UITableViewCellAccessoryCheckmark;
} else {
    cell.accessoryType = UITableViewCellAccessoryNone;
}

cell.selectionStyle = UITableViewCellSelectionStyleNone;

    return cell;

}

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


NSManagedObject *selectedObject = [self.fetchedResultsController objectAtIndexPath:indexPath];


if ([[selectedObject valueForKey:@"check"] boolValue]) {
    [selectedObject setValue:[NSNumber numberWithBool:NO] forKey:@"check"];
} else {
    [selectedObject setValue:[NSNumber numberWithBool:YES] forKey:@"check"];
}

UITableViewCell *thisCell = [tableView cellForRowAtIndexPath:indexPath]; 
if (thisCell.accessoryType == UITableViewCellAccessoryNone) {
    thisCell.accessoryType = UITableViewCellAccessoryCheckmark;  
} else {
    thisCell.accessoryType = UITableViewCellAccessoryNone;
} 
[tableView deselectRowAtIndexPath:indexPath animated:NO];       

}

I believe the line cell.textLabel.text = [item valueForKey@”name”];
is whats causing it. All that I would like for this to do is have the table populated from the array and check marks persisted. Any help is GREATLY appreciated. Thanks 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-13T18:10:58+00:00Added an answer on May 13, 2026 at 6:10 pm

    This line is replacing the cell text:

    cell.textLabel.text = [item valueForKey:@"name"];
    

    that was initially assigned by these lines:

    NSString *cellValue = [airport objectAtIndex:indexPath.row];
    cell.textLabel.text = cellValue;
    

    Why are your using the “name” property of “item”?

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

Sidebar

Related Questions

I have an app with a tab bar. Each tab has its own view
I'm working on an iPhone app that has a UITabBar. Occasionally the tab bar
Setup: Tab Bar App First View is a ScrollView which has an ImageView as
So my app's core is a tab bar. In each of 3 tabs is
Hi I've built an IOS app that has a tab bar and extracts content
I have a rails app that has picked up a bit of traction, but
I have a small app that has a Render thread. All this thread does
I have an existing app that has many, many models. I'd like to log
This is an interesting conundrum. We have a WPF app that has a Vista-like
I have a standalone Java app that has some licensing code that I want

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.