How to make Fetched Property SELF constrinat?
How to make Fetched Property SELF constrinat?
- Subject: How to make Fetched Property SELF constrinat?
- From: Javigator <email@hidden>
- Date: Tue, 5 Jul 2005 12:00:55 +0200
Another day, another problem:
Situation: I have a too-many-relationship "folder <---->> item", thus
one folder can contain many items and every item has exeactly one
folder. So far so good.
I was experimenting with Fetched Properties and thought it would be
nice to attach two of those to my "folder" structure to distinguish
between 'enabled' and 'disabled' items of a folder (an item has a
bool flag "disabled"). But I didn't came very far, at least in the
data model editor in Xcode.
The problem is: I cannot figure out out how to self constain a folder
in the Predicate Editor of the Fetched Property in Xcode.
Programatically I would have done it with two accessor methods -
(unsigned)disabledItems / -(unsigned)enabledItems where both aquire
the [[self valueForKey:@"items"] allObjects] array - because of the
relationship already constrained to the current folder object - and
filter that with a predicate of "disabled == TRUE" (or FALSE,
respectively)... this works as expected. Well, I'm thinking that for
the predicate editor in Xcode I need something like "folder == SELF
AND disabled = TRUE" with "item" as destination, but that doesn't
work. Woking from the "folder" end of the relationship doesn't work
either, at least for me and my tries with the predicate syntax.
Am I overlooking something here? Is this impossible to do with the
predicate editor in the data model of Xcode? Has anyone else got a
solution to this kind of problem and can point me to it?
Best regards,
Joern Janoschek.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden