Je suis en train de créer une application qui nécessite à la fois un contrôleur de vue et un contrôleur de barre d'onglets. Lorsque je démarre l'application, il faut charger le contrôleur de vue (qui est l'écran de connexion) et à partir de là, je dois aller à la vue du contrôleur de la barre d'onglets où l'application commence réellement.basculer entre viewcontroller et le contrôleur de la barre d'onglets
Voici ce que j'ai essayé:
appdelegate.h
#import <UIKit/UIKit.h>
@interface IeAppDelegate
: NSObject <UIApplicationDelegate, UITabBarControllerDelegate> {
UIWindow *window;
UITabBarController *tabBarController;
UIViewController *LoginController;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UITabBarController *tabBarController;
@property (nonatomic, retain) IBOutlet UIViewController *LoginController;
@end
appdelegate.m
@synthesize window;
@synthesize tabBarController;
@synthesize LoginController;
#pragma mark -
#pragma mark Application lifecycle
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
// Add the tab bar controller's view to the window and display.
LoginController = [[LoginController alloc] init];
[window LoginController.view];
[window addSubview:tabBarController.view];
[window makeKeyAndVisible];
return YES;
}
Je reçois ces erreurs et avertissements. Qu'est-ce que je fais mal?
warning: 'UIViewController' may not respond to '-alloc' warning: (Messages without a matching method signature warning: will be assumed to return 'id' and accept warning: '...' as arguments.) error: expected ']' before '.' token warning: 'UIWindow' may not respond to '-LoginController'
Mise à jour: Je compris une erreur:
LoginController = [[LoginViewController alloc] init];
Mais dans cette déclaration:
[window LoginController.view];
-je encore:
error: expected ']' before '.' token