On Sep 7, 2014, at 5:15 AM, Daryle Walker <dary...@mac.com> wrote: > Right now, the menu item that holds the submenu where the overflow menu items > go is always visible. I was thinking of controlling its visibility with Cocoa > Bindings. I select the menu item in the Interface Builder part of Xcode, go > to the Bindings Inspector, reveal the Hidden attribute settings, and set the > binding to my app’s delegate. Under the Model Key Path, I put > “self.my2ndCoordinator.overflowArray”. Now, that’s an array and I need a > Boolean. I tried “.count” and “.@count” at the end, and neither worked.
What does "neither worked" mean? What happened? ".@count" should work. ".count" would not. That effectively attempts to construct an array by asking each _element_ of overflowArray for its "count" property, which is always the way that KVC on arrays works. This will probably fail because the elements don't have a count property and even it succeeds, it would result in an array which is not an appropriate result for the hidden binding. (Also, starting a key path with "self." is just redundant.) > Even then, I still need to stick in the “> 0” part somewhere (unless Bindings > does the zero vs. non-zero to Boolean conversion C does). I don't know that I'd describe it as bindings "doing" that "conversion", but, yes, in a boolean context, 0 means false and non-zero means true. Since you presumably want the menu to be hidden when the count is 0, you want to use the NSNegateBoolean value transformer set on the binding. Regards, Ken _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com