IB Array Controller Fetch Predicate with Content Set

  • In interface builder...
    When I place a fetch predicate on an array controller that has it's
    parameters bound to the app delegate's model key path
    managedObjectContext, it works great.

    example that works:
    Parent Array Controller
    attributes
    mode: entity
    entity name: Parent
    fetch predicate: someParentAttribute == 1

    bindings
    Parameters
    bind to: someApp_AppDelegate
    Model Key Path: managedObjectContext

    This config brings back only results with someAttribute == 1 just as I
    want.

    If I have another array controller setup the same but also has it's
    controller content set to some other array controller's selection, the
    fetch predicate doesn't work.

    example that doesn't work:
    Child Array Controller
    attributes
    mode: entity
    entity name: Child
    fetch predicate: someChildAttribute == 5

    bindings
    Content Set
    bind to: Parent Array Controller
    controller key: selection
    model key path: childsParent

    Parameters
    bind to: someApp_AppDelegate
    Model Key Path: managedObjectContext

    This config brings back all of the child objects associated with the
    selected parent (good) regardless of what someChildAttribute is equal
    to (bad). The fetch predicate doesn't work.

    I'm assuming now that fetch predicates will not work for an array
    controller with it's content set.  Is this true? Am I just doing it
    wrong?

    Thanks and Merry Happy Ho Ho!
  • On Dec 24, 2007, at 1:48 PM, Steven Riggs wrote:

    > I'm assuming now that fetch predicates will not work for an array
    > controller with it's content set.  Is this true? Am I just doing it
    > wrong?

    Perhaps you want the filter predicate?

    mmalc
  • How do I set a filter predicate in interface builder?  I was enjoying
    the fact that I didn't have to code to put a fetch predicate in
    place.  Is it the same for a filter predicate?

    Thanks!

    On Dec 24, 2007, at 5:07 PM, mmalc crawford wrote:

    >
    > On Dec 24, 2007, at 1:48 PM, Steven Riggs wrote:
    >
    >> I'm assuming now that fetch predicates will not work for an array
    >> controller with it's content set.  Is this true? Am I just doing it
    >> wrong?
    >
    > Perhaps you want the filter predicate?
    >
    > mmalc
    >
  • On Dec 25, 2007, at 7:05 AM, Steven Riggs wrote:

    > How do I set a filter predicate in interface builder?
    >
    You can't.  (Typically you bind a search field that sets the
    predicate.)  Sometimes you just have to write some code...

    mmalc
previous month december 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today