NSSearchField and Core Data Problem
NSSearchField and Core Data Problem
- Subject: NSSearchField and Core Data Problem
- From: Matt Brook <email@hidden>
- Date: Wed, 11 Oct 2006 07:54:56 +0100
Dear All
I've been having a few nights in with a bit of Core Data.
Problem:
I have an entity called Test. It has two attributes - 'thing' which
is a string and 'theDate' which surprisingly enough is a date.
I have bound a two column table to the keyValues and dropped a mm/yy
type of formatter onto the 'theDate' column (as
I gather those little cell datepicker widgets don't work properly yet).
Next I added an NSSearchField thingy to the document.
Then populated a couple of search predicates - one for 'thing
beginswith[c] $value', and another for 'theDate > $value'
The problem I have is how to ensure that I send the correct $value
object type to the predicate for appropriate search matching.
I tried dropping a date formatter on the NSSearchField box, which it
accepted, and this allows me to perform date based searches ok.
Unfortunately it also tries to send an NSDate when using the 'thing
beginswith[c] $value' predicate, which is just plain wrong. I want
to send
a string to that one.
I have tried all sorts of click combinations with the NSSearchField
in Interface Builder to see if I can just drop a formatter onto a
drop down
for the date search, and avoid dropping it on the other. No joy.
So, I'm assuming that I must have to play around in code with a
subclass of NSSearchField so that the first search predicate gets
sent a string (looks like the default)
and the other one gets sent a date.
I would be delighted if there were some way to do this in Interface
builder, but I can't seem to find it.
Alternatively can the $value be sent as a particular object type by
modifiying the predicate somehow?
Helpful suggestions?
Many thanks
Matt Brook
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