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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:08:25+00:00 2026-05-22T21:08:25+00:00

I have a UITableView which displays historical data. This is broken up into one

  • 0

I have a UITableView which displays historical data. This is broken up into one section per day. Each day can have multiple things happening (eg. during a certain day I slept, ate some food, did some exercise, etc). Each “thing” is represented by a different entity. So going off the previous example, I have Day, Sleep, Food and Exercise entities. Sleep, Food and Exercise all have the Day entity as a parent, through a one-to-many relationship.

Currently what I am doing is loading all the Day entities, then for each Day I will load the Sleep, Food and Exercise entities into one single array, and sort it by date. Needless to say this gets slow when there is a lot of data.

Is it possible to use a NSFetchedResultsController in this instance?

  • 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-22T21:08:26+00:00Added an answer on May 22, 2026 at 9:08 pm

    This is just a guess, but I think the following would work:

    EDIT – I have just verified with a simple case, that this does work

    Have all of your event entities (Sleep, Food, Exercise) inherit from a base class entity (you could call it something like “Event”) and then use the following when you are setting up your NSFetchRequest that your NSFetchedResultsController will use:

    NSFetchRequest *fr = [[NSFetchRequest alloc] init];
    NSEntityDescription *entity = [NSEntityDescription entityForName:@"Event" inManagedObjectContext:_managedObjectContext];
    [fr setEntity:entity];
    

    In theory, this would cause your results controller to return all of your existing entities that inherit from Event. You could also put the relationship to Day in the base class (Event) because all your subclasses have that in common. Also, you would need to specify a predicate for your fetch request to only grab the events for the specific Day you are after.

    Let me know if this works!

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

Sidebar

Related Questions

I have a simple UITableView with two sections. Each section has a header which
I have an application which displays data in a UITableView. However, it crashes when
I have a NSFetchedResultsController which displays data in a UITableView. I'm using the boiler
I have a UITableView which displays about 5 cells at a time, yet in
I have a grouped UITableView which displays a number of cells, which includes both
I have an events app which gets events data from sqlite database and displays
I have a UIPopoverController which displays a UItableview. I use the PresentFromBarButtonItem method. How
I have a typical UITableView which displays a thumbnail image and some text. During
I have a UITableView instance tableView that displays data from a server. The tableView
I have a UITableView which generates its data from a pList. I have a

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.