Core Data Fetched Property: fetching children
Core Data Fetched Property: fetching children
- Subject: Core Data Fetched Property: fetching children
- From: Frank Reiff <email@hidden>
- Date: Mon, 26 Mar 2007 12:25:36 +0200
Hi,
This might be stupid Core Data newbie question, so I apologize in
advance..
I've got a Core Data hierarchy with three classes:
Node (Abstract superclass)
--> Folder (derived from Node)
--> File (derived from Node)
Node has the following properties:
* parent (one-to-one relationship to Node)
* children (one-to-many relationship to Node)
There is an inverse relationship between parent and children.
Now I want to be able to get ONLY the subfolders of a folder.
This is easily achieved using a predicate query on the "Folder" entity:
NSPredicate* predicate = [NSPredicate predicateWithFormat: @"parent
== %@", folder];
And this works just fine.
Now, I want to make this a fetched relationship, so I set the
predicate in the data model to: "parent == self" thinking that self
will be replaced by the "calling" object. This always returns 0 objects.
What am I doing wrong?
Best regards,
Frank
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden