On 2014 Sep 08, at 18:42, Daryle Walker <dary...@mac.com> wrote:

> Using Bindings puts the visibility synchronization code in the best spot, the 
> potentially affected menu items themselves.

I see what you mean.

> The KVO method came to mind first since I didn’t know about menu delegates 
> until later. I guess with the delegate method, I save all the changes with 
> the controllers then apply them all at once at presentation time when 
> -menuNeedsUpdate: (or -numberOfItemsInMenu: and -menu: updateItem: atIndex: 
> shouldCancel:) is called.

Again, I haven’t read your code in detail, but my high-level guess is that 
maybe you could create, or maybe you already have, a “MenuManager” object that 
could be interposed between your menu and the data model.  It would contain all 
of the arrays or whatever.  On the model side, you could expose bindings (in 
code) to these five whatever things that can change the data. On the view side, 
it would be the menu delegate.

> With KVO, menu presentation is standard, since all the applicable items are 
> already in place, reactively done when the WebHistory store changed.

Hey, if you can get Cocoa Bindings working directly on menus, more power to 
you!  I’m just sayin’ that the one time I tried that, I concluded it was all 
pain and no gain, and quite lonely.


_______________________________________________

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

Reply via email to