Skip navigation.
 
mlBest practice for actions invocation across multi-tiered subviews
FROM : Richard Adams
DATE : Wed Aug 27 19:32:19 2008

I feel this is a relatively newbie question, however the archive 
searching at http://search.lists.apple.com/ seems unavailable.

I am wondering what the best implementation practice is for the 
following scenario

I have a the following object view hierarchy (simplified for discussion)

Root View Controller
|-Action to Manipulate Main and Alternate View Controllers
|-View Controller (Alternate)
|-View Controller (Main)
      |-Main View
          |-Custom Button A
                |- Method to update attributes of Custom Button A
          |-Custom Button B
                |- Method to update attributes of Custom Button B
          |-Custom Button C
                |- Method to update attributes of Custom Button C

Now View Controller (Main) has no knowledge of any of the Custom 
Buttons as that is the job of Main View.  The Action in Root View is 
there to manage transitions, animations etc between the Main and 
Alternate views.  The Method of the Custom Buttons is specific to the 
button objects and gets invoked on a button event such as an event up.

The challenge I am having is that the method of the buttons needs to 
do it's local object updates and then invoke a view transition by 
calling the action in the Root View.  What is the best practice for 
"coding" the custom button method to invoke the root view action. 
Nothing I seem to think of is clean in maintaining the abstractions 
between the Root Controller and the Main Views implementation of the 
buttons.

Apologies if the question is too open ended - since it's a best 
practices question I'm trying to avoid "leading the witness".

Thanks in advance,

Richard

Related mailsAuthorDate
No related mails found.