To summarize, I tested my code carefully, and this is how I see CoreData's limitations regarding Fetching and objective-c predicated (i.e., point notation).
If an object was accessible by objective-c, and if one of its properties or relationships was changed, any NSFetchRequest with a predicate using dot notation will return the SQL storage structure, so the results will be erroneous.
In the case of the trivial example Family and Personality , if you have a link to Family and change its name , any request made in Person NSEntity cannot include a predicate with the following request element
@ "family.name =% @"
It will indeed request the use of the family name in the SQL repository. However, after such a change, the following query will work:
@ "family =% @"
In fact, NSFetchRequest will still retrieve information in the repository, but since the structure has not changed, it will replace the objects received by those stored in memory, so a subsequent test on [last name] will return the updated name.
With care, you can use a nested Predicate, for example:
@ "person.family.name =% @"
While you can guarantee that all objects that have the person property have not changed their family , but have not changed their name , if this is not so, then you can call at best
@ "person.family =% @"
Or if you cannot guarantee that all Family objects are intact, only
@ "person =% @"
Of course, the alternative is to systematically SAVE: NSManagedObjects in persistent storage every time you make any changes, so all properties are updated, and then all the above entries will work. However, there are times when you want to prevent savings and make the client change his document only if he wants to (think about Word, Excel, drawing tools, etc.). Hope this helps.