I’m trying to see if the View Controller is on Navigation stack and I’m lost in options of what to do. Here’s what I’m trying to do:
if ([((AppDelegate *)[UIApplication sharedApplication].delegate).frontViewController.navigationController.viewControllers containsObject:SGAddNewServerViewController]) {
<#statements#>
}
The problem is, how do I get the reference to SGAddNewServerViewController since I need to know its address with objectAtIndex... etc? XCode gives me an error of not knowing what it is and he’s right.
Any ideas of how can I get a reference to it without knowing its exact address on the NavigationStack? Thanks.
It appears you are trying to find the view controller based on its class. To do that, try this:
Please note that it is not a good idea to nest so many method/property calls into one line. It makes reading and debugging very difficult.