0
votes

I have a TabBar Controller in AppDelegate and then Navigation Controller on TabBar. But i get problem when i push Navigation Controller to other View Controller while remaining on first tabItem of TabBar.

My AppDelegate.h is:

 @interface IlmStreamAppDelegate : NSObject <UIApplicationDelegate,UINavigationControllerDelegate,UINavigationControllerDelegate> 
    {
        UIWindow *window;
        UITabBarController *rootViewController;
        UINavigationController *_navController;
    }

    @property (nonatomic, retain) IBOutlet UIWindow *window;
    @property (nonatomic, retain) IBOutlet UITabBarController *rootViewController;
    @property (nonatomic, retain) UINavigationController *navController;

    @end

My AppDelegate.m is:

  #import "IlmStreamAppDelegate.h"

    @implementation IlmStreamAppDelegate

    @synthesize window;
    @synthesize rootViewController;
    @synthesize navController;
    #pragma mark -
    #pragma mark Application lifecycle

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

        // Override point for customization after application launch.

        [rootViewController setTitle:@"Categories"];    
        _navController = [[UINavigationController alloc] initWithRootViewController:rootViewController];
        [window  addSubview:_navController.view];

        [self.window makeKeyAndVisible];

        return YES;
    }

    @end
1

1 Answers

0
votes

You can write write a custom XXTabBarController (plain subclass of UIViewController) that can be pushed onto a nav controller stack, but still have all the functionality of "view controller. Each "tab" has its own view controller.