Hi all,

I have a core data object graph using an SQLite store where several entities have an attribute containing a date (eg, birthDate). This is stored as a date type.

I am currently implementing an NSPredicateEditor for building smart groups. Each smart group simply saves this predicate to an attribute and then fetches using that.

The problem is that I want to offer to filter by ('days since birth' == 7), as well as (birthDate == 01/01/01). This is where I have hit a wall. I can't set a dynamic transient property for daysSinceBirth as these can't be used in fetch requests, and I can't convert the number of days to an absolute date as this loses the dynamic-calculation part of the number. I did think of using a transformable attribute to convert a second date field to an int, but then apparently this can't be used in a fetch request either.

I suppose that I could use a placeholder segment of predicate which is replaced when used, but this seems a bit awkward and inelegant.

Does anyone have any suggestions on how I could achieve this?

Regards,

Ben

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to