In my application, I post several local notifications, when they fire, I have to present a modal representation. The problem is that I have numerous view controllers, which of them can be active and, therefore, those that should represent the modal view controller. How to determine which one is currently in use?
I install the navigation controller as the view controller of the Windows root directory, and this can push any number of other view controllers, some of them themselves can also now be another view controller. This should work on iOS 4 and 5.
I have many view controllers, so I would not put code in each of them for every check if they are currently top.
source share