• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[Solved] Re: filterPredicate question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Solved] Re: filterPredicate question


  • Subject: [Solved] Re: filterPredicate question
  • From: Kubernan from 10191 Technologies <email@hidden>
  • Date: Mon, 28 Nov 2005 20:29:46 +0100

Thanks a lot for the help ;

I created a new NSArrayController in my nib and set its contents with
the Account controller using binding.
I'm able to apply a filterPredicate to this new controller.

Thanks again,
K.

Le 28 nov. 05 à 19:04, Wain a écrit :

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
References: 
 >filterPredicate question (From: Kubernan from 10191 Technologies <email@hidden>)
 >Re: filterPredicate question (From: Phil Frost <email@hidden>)
 >Re: filterPredicate question (From: Kubernan from 10191 Technologies <email@hidden>)
 >Re: filterPredicate question (From: Wain <email@hidden>)

  • Prev by Date: Re: Is Apple's singleton sample code correct?
  • Next by Date: Re: CFSocket freezes [solved]
  • Previous by thread: Re: filterPredicate question
  • Next by thread: webviw in a tab
  • Index(es):
    • Date
    • Thread