Re: Help with Predicate count/relationships
Re: Help with Predicate count/relationships
- Subject: Re: Help with Predicate count/relationships
- From: Matt Neuburg <email@hidden>
- Date: Thu, 04 Jan 2007 21:38:19 -0800
- Thread-topic: Help with Predicate count/relationships
On Thu, 4 Jan 2007 23:46:03 +0100, malcom <email@hidden> said:
>hello I'm using CoreData. I've an Entity called 'Article'. It contains a
>relationship (1..n)called "children" (replies to the istance). Now I would
>make two predicate strings:
>a) returns the number of 'article' that no contains childrens
>b) return the array of 'article' that contains childrens. I've found a
>@count function but I don't know how to make a predicate with it.
What I would do is have my managed object ("Article") respond to a value
"hasChildren", a Boolean. In other words, I'd put the logic for knowing the
answer to this question in the managed object, not in the fetching /
filtering mechanism. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
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