Re: contentSet filtering on an NSArrayController does not work
Re: contentSet filtering on an NSArrayController does not work
- Subject: Re: contentSet filtering on an NSArrayController does not work
- From: "Txinto Vaz" <email@hidden>
- Date: Thu, 1 Mar 2007 19:01:48 +0000
More data about the problem:
If I add to entity B a "filteredListOfAs" fetched property with
"B==$FETCH_SOURCE" predicate I get (at startup) an NSArray of the same
contents than the NSSet "listOfAs". If I unbind the contentSet from
"listOfAs" and set the contentArray to "filteredListOfAs", while keeping the
filterPredicate of the NSArrayController to "donotshow!=1"... the
NSTableView show me all the objects, no matter if the "donotshow" is on or
off. So, in this case, it is not an NSSet, is an NSArray and the filtering
does not work. I think maybe I am wrong in an interpretation of any concept
in the filtering methodology, but I don't know which one. If I set the
predicate of the fetched property to "B==$FETCH_SOURCE AND donotshow!=1" it
really filters the objects, but the dinamical behaviour is not the needed by
me.
Hope this can help to you to see where is my confusion.
Thank you.
Tx.
2007/3/1, Txinto Vaz <email@hidden>:
Hi, I have a property "donotshow" in an entity called A in Core Data. I
have a NSArrayController to manage the objects in this A entity and a
filterPredicate "donotshow!=1" on it so when I switch on the "donotshow" it
disappears from the list of objects shown in the typical NSTableView linked
to the NSArrayController through bindings. Everything works fine at this
point.
If I change the NSArrayController to bind the contentSet to a "to-many"
relationship called "listofAs" of an object of entity B, I can see in the
NSTableView all the objects linked to "listofAs", no matter if "donotshow"
is 1 or 0. So the only thing that changes from one situation to other is
that the NSArrayController is bound using contentSet instead of
contentArray, and the source for this collections is a "to-many"
relationship instead of an array.
Is the filterPredicate expected to work on contentSet the same way as it
does in contentArrays? I have searched in documentation and the only thing
I find is that filterPredicate filters the content of the NSArrayController,
without specifying if these contents come from a set or an array.
Thank you in advance for your help.
Tx.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden