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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:01:23+00:00 2026-05-23T00:01:23+00:00

I have 2 views we are dealing with. Main View, and Sub View. Main

  • 0

I have 2 views we are dealing with. Main View, and Sub View.

Main View’s tablecell’s string shows the count of the number of objects in that cell’s subView. When I delete a cell from the subview, and go back to the mainView, the string that shows the count should go down by 1. Right now this string is not changing until I restart the app.

Any ideas how I can fix this? The count is being pulled from a NSFetch.

Edit: Added Code

- (void)configureCell:(TDBadgedCell *)cell atIndexPath:(NSIndexPath *)indexPath
{
    NSDate *today = [NSDate date]; 
    NSDate *thisWeek  = [today dateByAddingTimeInterval: -604800.0];
    NSDate *thisMonth = [today dateByAddingTimeInterval: -2629743.83];
    else if (indexPath.row == 2)
    {
        NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
        self.predicate = [NSPredicate predicateWithFormat:@"(timeStamp >= %@) AND (timeStamp <= %@)", thisWeek, today];
        [fetchRequest setPredicate: predicate];
        [fetchRequest setEntity:[NSEntityDescription entityForName:@"Session" inManagedObjectContext:managedObjectContext]];
        NSError *error = nil;
        NSArray *results = [managedObjectContext executeFetchRequest:fetchRequest error:&error];
        NSLog(@"Fetch error: %@", error);

        cell.badgeString = [NSString stringWithFormat:@"%i", [results count]];
        [fetchRequest release];
    }
    else if (indexPath.row == 3)
    {
        NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
        self.predicate = [NSPredicate predicateWithFormat:@"(timeStamp >= %@) AND (timeStamp <= %@)", thisMonth, today];
        [fetchRequest setPredicate:predicate];
        [fetchRequest setEntity:[NSEntityDescription entityForName:@"Session" inManagedObjectContext:managedObjectContext]];

        NSError *error = nil;
        NSArray *results = [managedObjectContext executeFetchRequest:fetchRequest error:&error];
        NSLog(@"Fetch error: %@", error);

        cell.badgeString = [NSString stringWithFormat:@"%i", [results count]];
        [fetchRequest release];
    }
    else if (indexPath.row == 4)
    {
        cell.badgeString = [NSString stringWithFormat:@"%i", [[self.fetchedResultsController fetchedObjects] count]];
    }
  • 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-23T00:01:24+00:00Added an answer on May 23, 2026 at 12:01 am

    If your data is in fact being updated correctly on the model side of things, you should be able to call

    [tableView reloadData];
    

    and everything will update correctly. You can probably put this in viewWillAppear.

    Hope this helps.

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

Sidebar

Related Questions

I have two views, one view takes the whole screen, the second view covers
I have two views within one .xib (one view for landscape, another for portrait).
I have two views that I would like to combine into one. The first
All of a sudden in this MVC site I have no views that can
I have another issue related to Views, and i've ended up here dealing with
I have a view based app (not navigation or tab based...) My main view
I have a main ViewModel and my view which is great, and I have
I am dealing the view flipper with three views. The only problem which I
I have an app based on the Utility template (i.e. Main and Flip view
I'm dealing with a problem here. There's this view that I use to see

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.