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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:52:22+00:00 2026-05-24T19:52:22+00:00

I read this in the core data programming guide: In many cases, your initial

  • 0

I read this in the core data programming guide:

In many cases, your initial fetch retrieves a starting node in the object graph and thereafter you do not execute fetch requests, you simply follow relationships.

This makes sense if everything is linked to one object.

However, say i have this object model and relationship

Company (one to many) Team (one to many) Employee (one to one) Role

Say I load my Company at the start with a fetch request. I then have access to a set of Teams, and in each Team i have a set of Employees.

(this is all hypothetical, but my app follows the same model)

I want to load a UITableView that lists all Employees which have a Role of ‘developer’, and I want to do this using an NSFetchedResultsController.

I would like to create a fetched property on Company that returns all ‘developers’. Which is easy enough.

How would I link this fetched property to NSFetchedResultsController ?

  • 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-24T19:52:22+00:00Added an answer on May 24, 2026 at 7:52 pm

    I am not sure I understood your question, but if you want to use a NSFetchedResultsController with UITableView you have to use a NSFetchRequest, you cannot just follow relationship, which is use faulting.

    It seems you already have a fetch request, for use it with a fetched controller you have to pass such request to the NSFetchedResultsController.

    However you can get NSFetchedPropertyDescription by looking into the entity description, and its properties:

    NSEntityDescription *entityDescription = .....
    

    Then you can call properties and cycle all the array until you find your property:

    NSArray *allProperties = entityDescription.properties;
    NSFetchedPropertiesDescription *myPropertyDescription;
    for(NSPropertyDescription *propertyDescription in allProperties) {
      // find it by name or class
      if([propertyDescription isKindOfClass:[NSFetchedPropertyDescription class]])
        myPropertyDescription = (NSFetchedPropertyDescription*)propertyDescription;
    }
    
    NSFetchedRequest *fetchRequest = [myPropertyDescription fetchRequest];
    
            NSFetchedResultsController *myController = [[NSFetchedResultsController alloc]
                                                     initWithFetchRequest:fetchRequest
                                                     managedObjectContext:myManagedObjectContext
                                                     sectionNameKeyPath:nil
                                                     cacheName:myCacheName];
    

    I do not have my Mac right now so I cannot test for code validity, however it should be right.

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

Sidebar

Related Questions

This is the Core Data object model I am working with (I am a
From the iPhone Programming Guide When creating files or writing out file data, keep
I have this issue with Core Data. I am creating a core-data-based application, for
I read much about Core Data.. but what is an efficient way to make
I read this PHP RegEx page , but either I'm missing something, misreading something,
I read this answer and its comments and I'm curious: Are there any reasons
I read this post last night, and I noticed it was from 2006. I
I read This article and i found it interesting. To sum it up for
I have read this post about how to test private methods. I usually do
Update: Please read this question in the context of design principles, elegance, expression of

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.