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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:41:34+00:00 2026-05-12T13:41:34+00:00

I have setup Core Data for an iPhone app without an instance of NSFetchedResultsController.

  • 0

I have setup Core Data for an iPhone app without an instance of NSFetchedResultsController.

To do this, I created a created a model class to encapsulate all core data requests and constructing of NSFetchRequests/NSPredicates.

This kept all Core Data specific code out of my UITableViewController.

Now I want to add NSFetchedResultsController to make populating a sectioned UITableView easier.

My issue is this: In all examples I have seen the instance NSFetchedResultsController is an ivar of the UITableViewController. This leads to all NSFetchedResults statements constructed within the UITableViewController.

I feel like this is clutters the UITableViewController and adds another responsibility.

How do you deal with this?

What does your object graph look like when using NSFetchedResultsController?

Where do you construct your NSPredicates?

  • 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-12T13:41:34+00:00Added an answer on May 12, 2026 at 1:41 pm

    Update:

    I’ve gone back to constructing NSFetchedResultsControllers within the UITableViewControllers.

    I’ve also been using a category on NSManagedObjectContext for queries. Additionally, I have been putting more logic within categories on my NSmanagedObject subclasses.

    Overall, I am happy with the architecture I have been using as of late.


    Original Answer:

    I guess I’ll post my own take on the matter.

    Since NSFetchedResultsController is a Foundation class and not a UIKit class, it screams model to me.

    Same thing for NSFetchRequest.

    It seems that constructing a an NSFetchRequest relies on knowledge of the data model, which you could argue a UITableViewController should have no knowledge of.

    This leading me to several ideas about what the object graph should look like.

    One option is to subclass NSFetchedResultsController and make is like a factory class, where I return fully configured instances of NSFetchedResultsController. This keeps NSFetchRequest Construction.

    Another option is very similar, but instead of subclassing NSFetchedResultsController, I create a NSObject subclass or category that handles the same work.

    Both of these options seem to conform to MVC better than using the UITableViewController to perform those tasks.

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

Sidebar

Related Questions

I've created some MbUnit Test Fixtures that have SetUp methods marked with the SetUp
I have a setup project created by Visual Studio 2005, and consists of both
I have this setup where in my development copy I can commit changes on
I have setup web dav on windows server 2008. It seems to work fine
I have setup a property and implement INotifyPropertyChanged like so... public event PropertyChangedEventHandler PropertyChanged;
At the moment I have setup a custom ok cancel dialog with a drop
I am trying to implement performance testing on ActiveMQ, so have setup a basic
Setup Have you ever had the experience of going into a piece of code
I have a setup executable that I need to install. When I run it,
I have Eclipse setup with PyDev and love being able to debug my scripts/apps.

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.