Re: filterPredicate question
Re: filterPredicate question
- Subject: Re: filterPredicate question
- From: Wain <email@hidden>
- Date: Mon, 28 Nov 2005 18:04:05 +0000
Hi,
Phil is trying to say that you need to create a new NSArrayController
specifically to gather and filter the data you want, the pop-up would
then
display all of the data from the array controller.
I don't believe it is possible to perform the filtering directly in
the pop-up.
The content values binding accepts an array of strings, not a filter
predicate.
Wain
On 28 Nov 2005, at 17:54, Kubernan from 10191 Technologies wrote:
Le 28 nov. 05 à 16:56, Phil Frost a écrit :
On Mon, Nov 28, 2005 at 04:43:25PM +0100, Kubernan from 10191
Technologies wrote:
Hello,
The entity of my model (say bank Account) has a reflective
relationship (because a bank
account is attached to a main bank account).
In my GUI, creating a new bank account, i have to select the main
bank account with a popup menu.
What i want to do is to populate automatically the popup menu with
accounts set as "main" (a bool attribute in Account).
For that i thought i could use a filterPredicate with "content
values" binding of the popup menu but i didn't
find a place in IB to put my predicate.
What should i do for filtering my popup menu content ?
The filter predicate can be set by using the 'filter predicate'
binding
of NSArrayController. You will have to create a predicate on
something
else (window controller, app delegate, etc) and bind to that.
The fetch predicate can also be set in IB by looking at the
attributes
of an NSArrayController. If it is in entity mode, there is a text
area
that says by default "No predicate specified." You can type a
predicate
in there (like "main = true") and hit the "Set Predicate" button
to set
it.
The difference between the filter and fetch predicates is when the
predicate is applied. The fetch predicate will be used when the array
controller sends executeFetchRequest:error: to the
NSManagedObjectContext. The context will return only those objects
that
match. Then, the NSArrayController filters the results with the
filter
predicate.
_______________________________________________
Thanks, but it seems your solution is for filtering the
NSArrayController.
I don't want to filter this one but only the popup menu content :
my NSArrayController is used for adding/deleting any account. The
popup
menu should display only the main accounts inside this controller.
That's why i thought i could set the controller key to
"filterPredicate"
in "content Values" binding option of the NSPopupButton only.
But i don't know what to do after choosing "filterPredicate".
K. _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40yahoo.co.uk
This email sent to email@hidden
___________________________________________________________
Yahoo! Model Search 2005 - Find the next catwalk superstars - http://uk.news.yahoo.com/hot/model-search/
_______________________________________________
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