views:

211

answers:

1

I have a tab bar based application with navigation on each tab bar item. When i navigate to another view on any tab bar item and click on on tab bar item,then root view controller on that tab bar item is called. Its like PopToRootView . Can we disable this situation?

A: 

Though they say you're not supposed to subclass UINavigationController, you can what you want by making a subclass of UINavigationController and overriding the - (NSArray *)popToRootViewControllerAnimated:(BOOL)animated; method.

Doing this (and not calling the super popToRootViewController) will prevent the view controllers from popping when you click the tab bar item. It could run you into some problems somehow, but hopefully it works for you.

mjdth
Could you please tell me what is meaning of- (NSArray *)popToRootViewControllerAnimated:(BOOL)animated;with passing as 'NO' in animated parameter.
Himanshu