• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Core Data Fetched Property: fetching children
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Core Data Fetched Property: fetching children
      • From: mmalc crawford <email@hidden>
  • Prev by Date: Re: NSStatusItem position problem
  • Next by Date: Re: Core Data Fetched Property: fetching children
  • Previous by thread: Re: [RESOLVED] disable mouse clicks and keyboard shortcuts in nsmovieview
  • Next by thread: Re: Core Data Fetched Property: fetching children
  • Index(es):
    • Date
    • Thread