Re: Using filter predicate on an NSArrayController (simple q)
Re: Using filter predicate on an NSArrayController (simple q)
- Subject: Re: Using filter predicate on an NSArrayController (simple q)
- From: SA Dev <email@hidden>
- Date: Tue, 26 Jul 2005 11:39:58 -0400
Charilaos:
There are no filter predicates for tables or columns to my
knowledge. It's perfectly fine to hard-code a filter predicate for an
array controller (or any controller, really) - that's why there's a
box for it in IB. ;-)
Peter:
The problem is that newly-inserted objects are exempt from the
filter predicate (as they should be) so users can see them as they're
added. Once they're edited (either the filtered key or any key - I
don't know which at the moment), they disappear. Also, if you add
them, change them around (so you have a mix of matching and non-
matching objects), save your document, then re-open it, the filter
will apply as expected.
This is normal behavior, in other words.
On Jul 26, 2005, at 11:33 AM, Charilaos Skiadas wrote:
On Jul 26, 2005, at 8:24 AM, Peter Laurens wrote:
Hi,
I have a very basic setup, just one Entity in my Core Data model,
with one attribute 'name'.
I have created an interface by dragging the entity from the model
view in Xcode to IB.
This has set up the controller etc. for me.
However, I try and set a filter predicate for the
NSArrayController : name == "foo"
but this filter apparently makes no difference whatsoever, in the
tableview bound to the ArrayController I see all the entities
listed as I press the add button, and they all have their default
name which is *not* 'foo'.
Try to edit one of these entries to a name different than foo.
Then they'll go away.
If it didn't work that way, you would never be able to add objects
to your controller.
Is really what you want to control what objects are in the
controller, or what objects show up in the table view. In the
latter case, you probably want to be messing around with the
filterPredicate of the tableView or the tableViewColumn.
I was expecting that only entities with the name 'foo' would be
listed in the tableview. If someone has a moment, perhaps they
could enlighten me as to where I've misunderstood, and why this
isn't working as desired?
Thanks for any help - gratefully received,
- Peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40math.uchicago.edu
This email sent to email@hidden
Haris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40silentalcove.net
This email sent to email@hidden
_______________________________________________
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