Binding Keypath Modifiers?

Discussion in 'Mac Programming' started by Spike099, Jun 10, 2009.

  1. macrumors regular

    Joined:
    Feb 18, 2007
    Location:
    Canada
    #1
    I've got a very simple binding that enables a NSPopUpButton. The binding is a BOOL value. However I want the NSPopUpButton to be enabled when the BOOL value is false. Are there such a thing as keypath modifiers? Kinda like NSArray's @count, @max etc?

    I've searched everywhere but am obviously calling it the wrong name if it does exist.

    Thanks for your help.

    Edit:
    I'd like something like
    @not.isDisplayed
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    In IB's Bindings Inspector, try setting the Value Transformer to NSNegateBoolean. From the docs:
    This value transformer negates a boolean value, transforming YES to NO and NO to YES.​
     
  3. thread starter macrumors regular

    Joined:
    Feb 18, 2007
    Location:
    Canada
    #3
    Ahh yes! I knew this one wouldn't slip by you kainjow, thank you!
     

Share This Page