I have MainController class for UITabBarController's view managing.
When I try to display my TabBarController from ViewController - it display clear screen. :-( I could display my TabBarController only from __AppDelegate. =)
How can I display TabBarController from my UIViewController based view? =)
Please help me guys. Thank you a lot. =)
// MainController.h
@interface MainController : UIViewController {
IBOutlet UITabBarController * tabBarController;
}
@property (nonatomic, retain) IBOutlet UITabBarController * tabBarController;
@end
I have MyTestAppDelegate:
// MyTestAppDelegate.h
#import "MainController.h"
@class MainController;
@interface MyTestAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
MainController * mController;
IBOutlet UIViewController * viewController;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) MainController * mController;
@property (nonatomic, retain) IBOutlet UIViewController * viewController;
@end
// MyTestAppDelegate.m
#import "MyTestAppDelegate.h"
@implementation MyTestAppDelegate
@synthesize window, mController, viewController;
- (void)applicationDidFinishLaunching:(UIApplication *)application {
MainController * mc = [[MainController alloc] initWithNibName:@"MainView" bundle:nil];
self.mController = mc;
[mc release];
[window addSubview:[self.viewController view]];
[[viewController view] addSubview:[mController.tabBarController view]];
[window makeKeyAndVisible];
}
@end