
How to get back to the previous view controller in UINavigationController?

Generally, UINavigationController manages the push and pop functionality ..and it itself creates the Back Button to go back to the previous view controller.
See the example given below..
But in case if you have more then one root view controller ..you need to identify the correct root viewController to push it back.
In that case you can use UINavigationController's viewControllers property.
for example..
@property(nonatomic, copy) NSArray *viewControllers
Need to remember:
Note: "n" is the number of items in array.