• 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
Re: Help with Predicate count/relationships
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: CoreData - trying to avoid separate thread
  • Next by Date: Re: Observing bounds of an NSBezierPath
  • Previous by thread: Help with Predicate count/relationships
  • Next by thread: NSOpenPanel won't enable "Ok" button second time around
  • Index(es):
    • Date
    • Thread