Re: NSPredicateEditorRowTemplate for NSDate
Re: NSPredicateEditorRowTemplate for NSDate
- Subject: Re: NSPredicateEditorRowTemplate for NSDate
- From: Jim Turner <email@hidden>
- Date: Mon, 19 Jan 2009 15:04:55 -0600
The miracle is over. The out-of-the-box templates in IB only provide
three-view templates (left expression, operator, right expression).
You'll need to subclass NSPredicateEditorRowTemplate and provide the
views and logic you want to use in your template.
I did a presentation for the local CocoaHeads a while back on
NSPredicateEditor and my sample code does show a basic "Date is within
N days/weeks/months/years" if you'd like a starting point.
Go to http://groups.google.com/group/des-moines-cocoaheads/files and
look for "NSPredicateEditor.zip" (I'd direct link but the URL is a
monster).
--
Jim
http://nukethemfromorbit.com
On Mon, Jan 19, 2009 at 2:13 PM, Vitaly Ovchinnikov
<email@hidden> wrote:
> Hey, boys and girls?
> Am I the first, who use NSPredicateEditor?
> I just found that there is no default template for time values...
>
> Please somebody confirm that miracle is over and I need to code all
> this data/time stuff myself :(
>
>
> On Sun, Jan 18, 2009 at 7:22 PM, Vitaly Ovchinnikov
> <email@hidden> wrote:
>> Hello list,
>>
>> When I add a row template that edits date to predicate editor, it
>> allows to perform simple comparisons. Like less or greater or equal
>> etc. Smart folders in Finder allow to add clauses like "Date is within
>> last X weeks". I can't find a simple way to do the same. It seems that
>> the only way is to use custom view with that implements what I want,
>> but want to make sure that it is correct before I start.
>>
>> Maybe I missed something? Or maybe some standard implementation
>> already exists? I googled the Internet and this list - nothing.
>> Any ideas?
>>
>> Thank you.
>>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please 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
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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