Question

What's the rule of thumb if I want to change observed object's single property from different menu items (think - list of options).

E.g. I have an app that displays a car in a single window. I have a menu with menu item that says [Colors] with few submenu items like [Black, Green, Blue, Red, White, etc.]. How do I implement the mechanism behind this so that each submenu item changes same property (in this case - color) to different values.

Was it helpful?

Solution

If you're using target-action (IBAction) just point the menu at the same method in the same object and have the method make the appropiate changes.

If you're using bindings, then you set the keypath to the same attribute.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top