je MainController classe pour la gestion de la vue UITabBarControllerUITabBarController UIViewController View avec TabBarCtrl ne figure pas dans mon ViewCtrl :(
Lorsque je tente d'afficher mon TabBarController de ViewController -.. Il affiche un écran clair :-(Je ne pouvais afficher mon TabBarController seulement de __AppDelegate. =)
Comment puis-je afficher TabBarController de mon point de vue sur la base UIViewController? =)
S'il vous plaît aidez-moi les gars. Merci beaucoup. =)
// MainController.h
@interface MainController : UIViewController {
IBOutlet UITabBarController * tabBarController;
}
@property (nonatomic, retain) IBOutlet UITabBarController * tabBarController;
@end
Je 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