Tab Bar Controller (storyboard modèle) et AppDelegate

Quand je crée un XCode 4 iPhone modèle pour TabBarController avec storyboard, son automatiquement configuré avec une vue principale du contrôleur et tout et tout. Mais il n'y a pas de propery pour l'Onglet de la Barre de Contrôleur dans l'AppDelegate. Puis-je créé un exutoire pour elle, et a essayé de faire le lien avec mon Tab Bar Controller dans le storyboard, mais ce n'est pas possible. Est-il un meilleur moyen pour accéder à la Barre d'Onglet Contrôleur dans didFinishLaunchingWithOptions méthode, comme c'est déjà le genre de branché? Ce que je veux, c'est de l'auto.currentController = courant de l'onglet dans la Barre d'Onglet Contrôleur.

AppDelegate.h:

#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@end

AppDelegate.m:

@interface AppDelegate()

@property (nonatomic, assign) UIViewController<SubViewContainer> *currentController;

@end

@synthesize window = _window
@synthesize currentController;

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

//I need this piece of code to equal the Tab Bar Controller current tab
self.currentController = ?

return YES;
}

//And I'm gonna use this void for some statements about the Tab Bar Controller tabs:
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:
(UIViewController *)viewController
{
//with some statements
}

OriginalL'auteur ingenspor | 2012-07-29