NSArrayController Weirdness

Discussion in 'Mac Programming' started by Sbrocket, Mar 10, 2008.

  1. macrumors 65816

    Sbrocket

    Joined:
    Jun 3, 2007
    Location:
    /dev/null
    #1
    Hey there Cocoa gurus. I've recently started picking up Obj-C/Cocoa after telling myself I'd get around to it for a few years, and I'm running into some weirdness with bindings.

    I've gone through the great tutorial on bindings at cocoadevcentral and I got it to work perfectly, just as expected. However, when I try to apply the same principles to my own in-progress app the results are less than satisfactory.

    Ok...here's the situation as best I can explain it...
    I have an NSPopUpButton bound to an NSArrayController ("ConvertTypes") which controls an array of a self-defined class called "Type." This part works fine, although there is no updating of values involved with this pop-up.

    I then have two more NSPopUpButtons, each bound to an NSArrayController ("ConvertUnits1" and "ConvertUnits2"), which are each in turn bound to the selection of original ConvertTypes controller and control an array that is property of that Type class. (Hope this isn't too confusing yet...) The problem is this - if I change the selected value on the first pop-up menu, the 2nd and 3rd menus should update with the new values (they're units) specific to the selected value (a unit type) in the first pop-up. But they don't. :mad:

    If anyone could take a look, I'd be greatly appreciative...cause I'm stumped.
    http://dl.getdropbox.com/u/417/Converter.zip
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    Take a look at my post here. Bindings with popup buttons take slightly more work.
     
  3. thread starter macrumors 65816

    Sbrocket

    Joined:
    Jun 3, 2007
    Location:
    /dev/null
    #3
    Yeah, I just noticed the selection that wasn't changing. I'll take a look, thanks.

    Edit:
    Aha, thats the ticket. Thanks for the reply.
     

Share This Page