MPLauncherAppDelegate.m 1.23 KB
Newer Older
张杰's avatar
张杰 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
//
//  MPLauncherAppDelegate.m

#import "MPLauncherAppDelegate.h"
#import "MPTabBarController.h"

@interface MPLauncherAppDelegate ()

@property (nonatomic, strong) UINavigationController* naVC;
@property (nonatomic, strong) UIViewController *rootController;

@end

@implementation MPLauncherAppDelegate

- (id)init
{
    self = [super init];
    if (self)
    {
        UIViewController* tab1ViewController = (UIViewController *) [self createLoggingViewController:@"DemoViewController"];
        self.naVC = [[UINavigationController alloc] initWithRootViewController:tab1ViewController];
        self.rootController = tab1ViewController;
    }
    return self;
}

- (id)createLoggingViewController:(NSString *)className
{
    id vc;
    Class cl = NSClassFromString(className);
    if (cl != Nil) {
        vc = [[cl alloc]init];
    }
    else {
        vc = (DTViewController *)[[DTViewController alloc] init];
    }
    return vc;
}


- (UIViewController *)rootControllerInApplication:(DTMicroApplication *)application
{
    return self.rootController;
}

- (void)applicationDidFinishLaunching:(DTMicroApplication *)application
{

}

- (void)application:(DTMicroApplication *)application willResumeWithOptions:(NSDictionary *)launchOptions
{

}

@end