CD: Predicate Builder - specifying NULL relationship
CD: Predicate Builder - specifying NULL relationship
- Subject: CD: Predicate Builder - specifying NULL relationship
- From: Fritz Anderson <email@hidden>
- Date: Mon, 20 Mar 2006 22:59:01 -0600
In this question, a Slot relates to one Bank, and to one Entry. The
relationships are named bank and entry, respectively. The entry
relationship is optional, the bank relationship is not.
I am trying to fetch all Slots that belong to a particular Bank, and
have no Entry associated with them. I believe the proper predicate is:
bank == $BANK AND entry == NULL
with BANK to be supplied later. Assuming this is a sensible thing to
do (please tell me, otherwise)...
(1) How does one construct this predicate in Xcode's predicate
editor? I've got
bank = [variable] BANK
AND
entry = [constant] NULL
This yields the expression
bank == $BANK AND entry == "NULL"
which is not what I want -- I want to match NULL, not the string
"NULL". My understanding of the predicate syntax is that NULL,
without quotes, is a constant.
Using [variable] NULL in the second term produces
bank == $BANK AND entry == $#NULL
which I assume is not what I want. Searching the Cocoabuilder archive
for $#NULL produces everything with "null" in it, which is unhelpful.
(2) Slots have a property "ordinal," which is Integer16, and
optional. Slots in excess of a Bank's capacity (as my happen in an
intermediate state while moving slot contents around) don't set
ordinal. Am I right in assuming that it is sensible to speak of
ordinal's value being NULL in such cases?
(3) If (2) is yes, how can I use the predicate editor to find excess
slots that are empty, and can be scavenged? I believe the expression is
bank == $BANK AND entry == NULL AND ordinal == NULL
Attempting to put [constant] NULL in the right-hand side of the third
subexpression produces an alert saying the rhs can't be parsed. I'd
guess that it's looking for integers only.
Specifying [variable] NULL returns us to problem (1).
[Suppressing complaint that the variable/constant/key setting should
not be hidden in a right-click menu, on the assumption that I'm not
the first.]
Any guidance would be greatly appreciated.
-- F
--
Fritz Anderson -- http://www.manoverboard.org/
Consulting Programmer -- http://resume.manoverboard.org/
Step into Xcode, Now Available -- http://six.manoverboard.org/
_______________________________________________
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