I'm sure there is a correct way to do this, I'm new to objective-c and cocoa touch so I don't know what it is.
I have an application that has a (simplified) view hierarchy of
Window
--Button
--Button
--Subview
--Sub-Subview
What I'm trying to do is get the subview to do something in response to a touch event on one of the buttons. I can come up with a few methods of doing this, but I'm not sure which one is the preferred method.
Add an outlet to the Main view controller (handling the window) and storing a reference to the subview. When I need to message subview, I can simply pass the message I want (since I'll already have a reference). This seems workable, if a little ... fragile?
Add a second action to the button (the first is a method on the view controller, the second would be a method on the subview class). This seems problematic since it is important that the button's action in the view controller fire before the subview tries to handle the message
Some sort of delegate system?
Write a new view controller for the subview and have the main view controller pass that a message (not sure the correct way for the first controller to get a reference to the second. In addition, the code actually required for the subview is relatively small - a whole new controller seems like overkill).
Something else that I'm overlooking completely?
Some direction would be appreciate!