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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:07:05+00:00 2026-05-27T12:07:05+00:00

I have a core data relationship that looks like this ItemA ->> ItemB where

  • 0

I have a core data relationship that looks like this

ItemA ->> ItemB

where as itemA has many of itemB. i wanted to use a fetched property that allowed me to grab all associated of itemB that were associated with itemA that had an int32 status property set as “2”. So i created a fetched property in the data modeler that had the following:

fetched property: completedItem
predicate: status == 2
destination: itemB

when i first tried it out, i got items back and i thought that was all cool and done, then later i noticed odd behavior and when i looked closer the items that it returned had nothing to deal with actual amount of itemB that was associated with an itemA object. Even weirder is that the return type is NSFaultingMutableArray. Here’s a quick example

  • ItemA has 0 of itemB
  • a filtered predicate search on the NSSet property ItemA has of ItemB returns 0
  • the fetched property “completedItem” returns 4 of ItemB
  • the type it returns is NSFaultingMutableArray

This is just weird in my head right now and really isn’t making sense. any ideas?

UPDATE 1:

it appears the fetched property listed here gets all ItemB objects that core data has to offer that matches the predicate, even if it’s not associated with the ItemA in question

  • 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-27T12:07:07+00:00Added an answer on May 27, 2026 at 12:07 pm

    Here’s the answer to this all the weirdness in this issue:

    1) The fetched properties indeed were not returning ItemB objects just for ItemA. In order for this to occur, you have to add something like this in the fetched properties predicate

    status == 2 AND ItemA == $FETCH_SOURCE
    

    2) From the Fetched Properties documentation:

    A fetched property is evaluated lazily, and is subsequently cached.

    If objects in the destination entity are changed, you must reevaluate the fetched property to ensure it is up-to-date. You use refreshObject:mergeChanges: to manually refresh the properties—this causes the fetch request associated with this property to be executed again when the object fault is next fired.

    so basically use refreshObject:mergeChanges to manually refresh the object to reload the fetched property. you can do this by adding a refresh method or by doing some fancy overriding to the KVC get method inside your subclassed NSManagedObject.

    This being said, others here (Rob Booth, Grady Player), have other valid solutions by bypassing fetched properties entirely. While these are faril

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

Sidebar

Related Questions

I have a core data entity A that has a one-to-many relationship with entity
I have an application that uses Core Data that has a relationship that I
I have a relationship in a Core Data model that feels like it wants
My Core Data model looks like this: alt text http://fwdr.org/lg4q The players relationship of
I have a core data class Game which has a to-many relationship to another
I have a Core Data entity, bid, which has a relationship to many items,
I have two core data entities, Articles and Favorite . Articles has To-Many relationship
I have a Core Data model setup like so: Blockbuster Entity To-Many relationship to
I have created a core data model that has two entities which have a
I have a core data model that has two entities, Bid and Result. I

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.