0

In a Single View Application, Inside the storyboard if I've multiple view controllers with different classes assigned to them,

How can I access all of them inside AppDelegate while still know what kind (Class) of ViewController is this?

for instance root view controller I can access

BlackTimer *vc = (BlackTimer *)_window.rootViewController;

how about the other sibling view controllers?

  • Answer is http://stackoverflow.com/questions/8186375/storyboard-refer-to-viewcontroller-in-appdelegate –  Jun 10 '12 at 16:11

1 Answers1

1

Create iVar of your sibling UIViewControllers inside your app delegate and later whenever you invoke a view controller you alloc init the ivar which is inside app delegate. You can get reference to app delegate from anywhere by using

[UIApplication sharedApplication] delegate];
TeaCupApp
  • 11,316
  • 18
  • 70
  • 150
  • Sorry it's still not clear to me, inside AppDelegate. I wanna access all the view controllers (from storybaord) –  Jun 10 '12 at 15:36