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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:53:28+00:00 2026-06-09T17:53:28+00:00

I have a NSFetchedResultsController to get the data for an UITableView . During the

  • 0

I have a NSFetchedResultsController to get the data for an UITableView. During the creation of the NSFetchedResultsController I create a NSPredicate that filters the data with an external condition. What’s the proper way to refetch the data? Just nil’ing the my __fetchedResultsController and recreating it seems a little bit brutal.

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-06-09T17:53:29+00:00Added an answer on June 9, 2026 at 5:53 pm

    As indicated in my comment above I figured it out. What you need to do is save a reference to the NSFetchRequest and manipulate that straight away when needed. As a second step, you need to tell your NSFetchedResultsController to fetch it’s data again.

    I did this by adding two new methods to the default NSFetchedResultsController “stack”:

    - (void)configureFetchRequest {  
        NSObject *myExternalDependency = …;
    
        if (!__fetchRequest) {
            __fetchRequest = [[NSFetchRequest alloc] init];
        }
    
        NSEntityDescription *entity = [NSEntityDescription entityForName:@"EntityName" inManagedObjectContext:self.managedObjectContext];
        [__fetchRequest setEntity:entity];
    
        NSPredicate *filter = [NSPredicate predicateWithFormat:@"someValue == %@", [myExternalDependency someProperty]];
        [__fetchRequest setPredicate:filter];
    }
    
    - (void)performFetch {
        NSError *error = nil;
        if (![self.fetchedResultsController performFetch:&error]) {
            NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
            abort();
        }
    }
    

    So what I basically do now is call these two methods on creation of __fetchedResultsController (which I do initialize using __fetchRequest, of course) and every time my external dependency changes. That’s it.

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

Sidebar

Related Questions

I have setup a UITableView using a NSFetchedResultsController that displays a number of prototype
I'm having problem how to formulate NSPredicate to get correct data. I have three
I have a parent class that handles all the UITableview persistent data management and
Currently I have a UITableView with its data source being an NSFetchedResultsController . The
I have a UITableView based on a NSFetchedResultsController . To insert a new row
I have a table view that is managed by an NSFetchedResultsController. I am having
I have a UITableView which is backed by a NSFetchedResultsController . I would like
I have a list of objects in a UITableView , managed by a NSFetchedResultsController
I am having a Core Data problem with NSFetchedResultsController . I have a one
I have a app that works with Core Data. The data has a field

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.