objective c - ViewController Delegate -


is possible access viewcontroller's methods appdelegate, possible inverse following code:?

appdelegate *ad = (appdelegate *) [[uiapplication sharedapplication] delegate]; 

when try

viewcontroller *vc = (viewcontroller *) [[uiapplication sharedapplication] delegate]; 

i error...

thanks!

viewcontroller *vc = (viewcontroller *)[uiapplication sharedapplication].keywindow.rootviewcontroller; 

or if delegate have properties

yourappdelegate *ad = (yourappdelegate*)[uiapplication sharedapplication].delegate; viewcontroller *vc = ad.yourviewcontrollerproperty; 

Comments

Popular posts from this blog

Glib GIOChannel -

delphi - When I encode/decode SMS PDU (GSM 7 Bit) user data, do I need prepend the UDH first? -

python - Obscure curses error message when creating a sub window -