objective c - ObjC/iPad buttons in subviews calling methods in master controller. How? -


is model mess?

i'm writing ipad app multiple views. have masterviewcontroller subviews other view controllers. of these subviews contain buttons.

the user clicks these buttons change views. intention masterviewcontroller responsible changing these views. how?

how can masterviewcontroller tell when button pressed?

@implementation subviewcontrollerone  - (ibaction) switchtosubviewtwo {  //where send message? [masterviewcontroller mymethod] //doesn't work because need message specific instance  } 

you could

  1. pass reference master controller sub controllers , tell way
  2. make master controller singleton , reference way
  3. you have sub controllers post nsnotification master listens for.

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -