Re: CD: Predicate Builder - specifying NULL relationship
Re: CD: Predicate Builder - specifying NULL relationship
- Subject: Re: CD: Predicate Builder - specifying NULL relationship
- From: Ashley Clark <email@hidden>
- Date: Thu, 23 Mar 2006 09:58:35 -0600
In the predicate builder, select Expression from the pop-up button,
then manually write your condiition, e.g. "attribute == NULL". This
will allow you to generate the correct predicate expression.
One caveat though. After creating a predicate this way, I was then
unable to reopen that predicate in the predicate builder, because it
kept giving me this error.
---
Uncaught Exception:
Invalid parameter not satisfying: aString != nil
On Mar 23, 2006, at 9:13 AM, Fritz Anderson wrote:
The favor of a reply would be greatly appreciated.
The summary is that I would like to test for null attributes in a
predicate built from the Xcode predicate builder. Simply using
attribute == NULL quotes the string ("NULL"), which I believe is
not what I want. I have tried the "variable" variant of the rhs,
and gotten $#NULL, which I am not sure is what I want.
-- F
On 20 Mar 2006, at 10:59 PM, Fritz Anderson wrote:
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:
40manoverboard.org
This email sent to email@hidden
_______________________________________________
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
Ashley Clark
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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