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

Ask A Question

Stats

  • Questions 201k
  • Answers 201k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The IconFile property of the TabInfo object returns the filename… May 12, 2026 at 8:08 pm
  • Editorial Team
    Editorial Team added an answer The following link has the explanation-- http://www.cmcandrew.com/robocolumn/the-perils-of-context-sensitive-help/ You have to… May 12, 2026 at 8:08 pm
  • Editorial Team
    Editorial Team added an answer Your algorithm description is unclear. There's no exact rule where… May 12, 2026 at 8:08 pm

Related Questions

I have an application that uses CoreData. I previously had a class named Marker
As a side project I'm currently writing a server for an age-old game I
I'm trying to use a discriminator field in my linq to sql setup. I
I have a few Munin plugins which report stats from an Autonomy database. They

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.