Smart Lists : another way to explore...
Smart Lists : another way to explore...
- Subject: Smart Lists : another way to explore...
- From: WhiteContainer <email@hidden>
- Date: Fri, 24 Mar 2006 06:54:29 +0100
Hi,
As I progress quickly with cocoa and coredata, I was thinking about
implemanting smart lists (yes, I am fast and furious).
I have browsed the CoreRecipes code and it seems to be complex to do.
I have my own idea but I am not sure it is relevant :
- Create 2 entities corresponding to operators or expressions and
create the mo instances by default at startup :
an entity with coredata attributes (departmentName,
departementManager...), and an entity with operators (= >= <= LIKE..).
- Create an entity called Predicate with 2 one-to-many relationship
with the 2 previous entities, and an attribute with a "blank" value,
fullfilled by the user at runtime.
So in IB it would be a tableView bound to Predicate, with 2 pop-up
menu 1 with operators and 1 with coradate attributes (for each line
of the tableView) and a column for the blank expression.
- Create an entity called SmartList :
An attribute called myPredicate
A fetch request with the myPredicate as an argument (to be delivered
at runtime).
OR
In the delegate, set the predicate of the arrayController I am
interested in, to myPredicate (delivered at runtime).
The aim is to convert the objects created by the Entity Predicate to
a single predicate, maybe in a method with stringWithObject(s) or
something like that.
So at runtime :
>Add: a smartList
>Choose your predicate with pop-ups and expression, add: another
line if you need ; in the same time it will setValue of the smartList
's myPredicate and "prepare" the fetch request with a predicate.
>Click on fetch: to call the request.
1- Does it sound "smart" or stupid ? :D
2- To convert the objects to a predicate : is it easy to do that ?
Has someone an idea ?
PS: I forgot the AND and OR, it could be a pop-up at the end of the
line of the tableView, the user should not choose in this popup for
the last line (you can not end a predicate with AND or OR).
Kind Rgds.
_______________________________________________
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